Skip to content

Commit

Permalink
Merge branch 'bohdan-s:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Havlik authored May 29, 2022
2 parents 36454a0 + ff234bc commit f7fb734
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion SunGather/exports/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def publish(self, inverter):
config_msg['unique_id'] = "inverter_" + self.cleanName(ha_sensor.get('name'))
config_msg['state_topic'] = self.mqtt_config['topic']
config_msg['value_template'] = "{{ value_json." + ha_sensor.get('register') + " }}"
config_msg['unit_of_measurement'] = inverter.getRegisterUnit(ha_sensor.get('register'))
if inverter.getRegisterUnit(ha_sensor.get('register')):
config_msg['unit_of_measurement'] = inverter.getRegisterUnit(ha_sensor.get('register'))
if ha_sensor.get('dev_class'):
config_msg['device_class'] = ha_sensor.get('dev_class')
if ha_sensor.get('state_class'):
Expand Down

0 comments on commit f7fb734

Please sign in to comment.