1
0
mirror of synced 2026-03-23 10:53:41 +00:00

Update amcrest2mqtt.py

Update payload structure for JSON schema change
This commit is contained in:
Dan Clough
2022-11-17 21:50:22 -06:00
committed by GitHub
parent 7729a2712f
commit e7d4d94336

View File

@@ -458,7 +458,7 @@ async def main():
if (is_ad110 and code == "ProfileAlarmTransmit") or (code == "VideoMotion" and not is_ad110): if (is_ad110 and code == "ProfileAlarmTransmit") or (code == "VideoMotion" and not is_ad110):
motion_payload = "on" if payload["action"] == "Start" else "off" motion_payload = "on" if payload["action"] == "Start" else "off"
mqtt_publish(topics["motion"], motion_payload) mqtt_publish(topics["motion"], motion_payload)
elif code == "CrossRegionDetection" and payload["data"]["ObjectType"] == "Human": elif code == "CrossRegionDetection" and payload["data"]["Object"]["ObjectType"] == "Human":
human_payload = "on" if payload["action"] == "Start" else "off" human_payload = "on" if payload["action"] == "Start" else "off"
mqtt_publish(topics["human"], human_payload) mqtt_publish(topics["human"], human_payload)
elif code == "_DoTalkAction_": elif code == "_DoTalkAction_":