Update mqtt.py
Add "no_motion" publish = no-motion time 120, 180, ....(s)
This commit is contained in:
@@ -95,7 +95,10 @@ class Mqtt:
|
|||||||
items = {}
|
items = {}
|
||||||
for key, value in data.items():
|
for key, value in data.items():
|
||||||
# fix for latest motion value
|
# fix for latest motion value
|
||||||
|
if (model in self.motion_sensors and key == "status"):
|
||||||
|
items["no_motion"] = 0
|
||||||
if (model in self.motion_sensors and key == "no_motion"):
|
if (model in self.motion_sensors and key == "no_motion"):
|
||||||
|
items[key] = value
|
||||||
key = "status"
|
key = "status"
|
||||||
value = "no_motion"
|
value = "no_motion"
|
||||||
if (model in self.magnet_sensors and key == "no_close"):
|
if (model in self.magnet_sensors and key == "no_close"):
|
||||||
|
|||||||
Reference in New Issue
Block a user