From aad0bacc0634e3f7d88d2bfa3f1b91e1bebea6f8 Mon Sep 17 00:00:00 2001 From: cauer71 Date: Thu, 15 Sep 2022 08:54:35 +0200 Subject: [PATCH 1/2] docs: update metadata bam, fre --- src/wattpilot/ressources/wattpilot.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/wattpilot/ressources/wattpilot.yaml b/src/wattpilot/ressources/wattpilot.yaml index 99f2a8c..92b7bc6 100644 --- a/src/wattpilot/ressources/wattpilot.yaml +++ b/src/wattpilot/ressources/wattpilot.yaml @@ -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 jsonType: boolean example: false @@ -1321,8 +1328,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 From 2176d3e4b4d3883c142135912a6ac87f39b9fbf1 Mon Sep 17 00:00:00 2001 From: cauer71 Date: Sat, 22 Oct 2022 11:45:47 +0200 Subject: [PATCH 2/2] Update wattpilotshell.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Quick and dirty fix für mqtt error --- src/wattpilot/wattpilotshell.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wattpilot/wattpilotshell.py b/src/wattpilot/wattpilotshell.py index 98849f9..c1d34cd 100644 --- a/src/wattpilot/wattpilotshell.py +++ b/src/wattpilot/wattpilotshell.py @@ -891,8 +891,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)