Skip to content

Commit

Permalink
Merge pull request #25 from cauer71/add-metadata-bam,-fre
Browse files Browse the repository at this point in the history
docs: update metadata bam, fre
  • Loading branch information
joscha82 authored Nov 21, 2022
2 parents 1a561b4 + 2176d3e commit 4712ba3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
16 changes: 15 additions & 1 deletion src/wattpilot/ressources/wattpilot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,15 @@ properties:
config:
entity_category: config
- key: bam
alias: buttonAllowMode
title: Button Allow mode change
jsonType: boolean
example: true
rw: R/W
type: bool
category: Status
description: Allow mode change via hardware button on Wattpilot
homeAssistant:
- key: cae
alias: cloudApiEnable
title: Cloud API Enable
Expand Down Expand Up @@ -1336,8 +1343,15 @@ properties:
jsonType: boolean
example: true
- key: fre
alias: froniusRemainEco
title: Remain Eco
jsonType: boolean
example: false
example: true
rw: R/W
type: bool
category: Status
description: Remain in Eco mode after next trip minimum energy has been charged into to the car
homeAssistant:
- key: frm
alias: roundingMode
title: Rounding Mode
Expand Down
6 changes: 4 additions & 2 deletions src/wattpilot/wattpilotshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,8 +859,10 @@ def mqtt_set_value(client, userdata, message):
pd = wpdef["properties"][name]
if pd['rw'] == "R":
_LOGGER.warning(f"Property '{name}' is not writable!")
value = mqtt_get_decoded_property(
pd, str(message.payload.decode("utf-8")))
try:
value = int(mqtt_get_decoded_property(pd, str(message.payload.decode("utf-8"))))
except ValueError:
value = mqtt_get_decoded_property(pd, str(message.payload.decode("utf-8")))
_LOGGER.info(
f"MQTT Message received: topic={message.topic}, name={name}, value={value}")
wp.send_update(name, value)
Expand Down

0 comments on commit 4712ba3

Please sign in to comment.