瀏覽代碼

BugFix: RX current setpoint

master
Dirk Alders 1 年之前
父節點
當前提交
4fb01e2f93
共有 1 個文件被更改,包括 5 次插入4 次删除
  1. 5
    4
      z_server/devices/__init__.py

+ 5
- 4
z_server/devices/__init__.py 查看文件

@@ -90,10 +90,11 @@ class brennenstuhl_heatingvalve(base):
90 90
 
91 91
     def __rx__(self, client, userdata, message):
92 92
         payload = json.loads(message.payload)
93
-        if message.topic == self.topic + '/set':
94
-            self.target("current_heating_setpoint", payload["current_heating_setpoint"])
95
-        if message.topic == self.topic:
96
-            self.state("current_heating_setpoint", payload["current_heating_setpoint"])
93
+        if "current_heating_setpoint" in payload:
94
+            if message.topic == self.topic + '/set':
95
+                self.target("current_heating_setpoint", payload["current_heating_setpoint"])
96
+            if message.topic == self.topic:
97
+                self.state("current_heating_setpoint", payload["current_heating_setpoint"])
97 98
 
98 99
 
99 100
 class silvercrest_powerplug(base):

Loading…
取消
儲存