Skip to content

Commit

Permalink
Fixed merge issue
Browse files Browse the repository at this point in the history
  • Loading branch information
graham22 committed Jan 28, 2024
1 parent c036133 commit 0805108
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/Python/classic_mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def periodic(modbus_stop):
modbusErrorCount = 0
if (not infoPublished): #Check if the Info has been published yet
#
if ( argumentValues['homeassistant'] == True ): #Check if HA_enabled is true
if ( homeassistantEnabled ): #Check if HA_enabled is true
log.debug("Call mqttHAautodiscovery" )
mqttHAautodiscovery( data )
# wait 1 second for HA to receive and create device
Expand All @@ -412,7 +412,7 @@ def periodic(modbus_stop):
#
if mqttPublish(mqttClient,encodeClassicData_readings(data),"readings"):
#
if ( argumentValues['homeassistant'] == True ): #Check if HA_enabled is true
if ( homeassistantEnabled ): #Check if HA_enabled is true
# re-send ChargeState because of icon
if mqttLastCSicon != data["ChargeStateIcon"]:
mqttLastCSicon = data["ChargeStateIcon"]
Expand Down
2 changes: 2 additions & 0 deletions code/Python/compose-override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ services:
- MQTT_HOST=mosquitto
- MQTT_PORT=1883
- MQTT_ROOT=ClassicMQTT
# uncomment to enable Home Assistant discovery
# - HA_ENABLED=True
# - MQTT_USER=ClassicPublisher
# - MQTT_PASS=ClassicPub123

Expand Down
1 change: 1 addition & 0 deletions code/Python/support/classic_jsonencoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def encodeClassicData_info(decoded):
# "deviceName":"CLASSIC",
classicData["deviceName"] = "".join(chr(x) for x in uint_array).strip(chr(0))
# "buildDate":"Tuesday, February 6, 2018",
bdate = datetime.date(decoded["Year"],decoded["Month"],decoded["Day"])
classicData["buildDate"] = bdate.strftime("%A, %B %d, %Y").replace(' 0', ' ') # get rid of the stupid leading 0 in date.
# "deviceType":"Classic",
classicData["deviceType"] = "Classic"
Expand Down

0 comments on commit 0805108

Please sign in to comment.