Skip to content

Commit

Permalink
Improvements to HASS sensor names
Browse files Browse the repository at this point in the history
  • Loading branch information
ngardiner committed Oct 14, 2019
1 parent 18963b0 commit f449a0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This document shows the changes per release
* Improvements to HomeAssistant EMS module to avoid setting Consumption/Generation values to zero as a result of a connection failure, and better exception handling in general for the module.
* Added EMS support for TED (The Energy Detective)
* Added Control module support with a first control module for MQTT, with initial commands to stop the TWCManager daemon and start charging immediately.
* Improvements to the MQTT and HASS topic/sensor names for Slave TWCs.
* Improvements to the MQTT and HASS topic/sensor names for Slave TWCs. (4 byte instead of 2 byte)

## v1.1.0 - 2019-10-12

Expand Down
10 changes: 9 additions & 1 deletion lib/TWCManager/Status/HASSStatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ def debugLog(self, minlevel, message):
print("debugLog: (" + str(minlevel) + ") " + message)

def setStatus(self, twcid, key, value):
sensor = "sensor.twcmanager_" + str(twcid.decode("utf-8")) + "_" + key

# Format TWCID nicely
twident = None
if (len(twcid) == 2):
twident = "%02X%02X" % (twcid[0], twcid[1])
else:
twident = str(twcid.decode("utf-8"))

sensor = "sensor.twcmanager_" + str(twident) + "_" + key

if (self.status):

Expand Down

0 comments on commit f449a0d

Please sign in to comment.