default empty telemetry, how to pull it in

pull/106/head
Jeff Culverhouse 11 months ago
parent 874d659ffa
commit 8fbcd3e316

@ -202,6 +202,8 @@ def get_device(amcrest_host, amcrest_port, amcrest_username, amcrest_password, d
"hardware_version": hardware_version,
"vendor": vendor,
},
"telemetry": {
},
"topics": {
"config": f'{config["mqtt"]["prefix"]}/{serial_number}/config',
"status": f'{config["mqtt"]["prefix"]}/{serial_number}/status',
@ -438,7 +440,7 @@ def refresh_device(device):
},
}, json=True)
mqtt_publish(device['topics']['telemetry'],
device['telemetry'] if 'telemetry' in device else {},
dumps(device['telemetry']),
json=True)
def refresh_storage_sensors():
@ -568,7 +570,7 @@ async def main():
device_config = device["config"]
device_topics = device["topics"]
async for code, payload in device["camera"].async_event_actions("All"):
log(f"Event on {host}: {str(payload)}")
log(f"Event on {host} - {code}: {payload['action']}")
if ((code == "ProfileAlarmTransmit" and device_config["is_ad110"])
or (code == "VideoMotion" and not device_config["is_ad110"])):
motion_payload = "on" if payload["action"] == "Start" else "off"

Loading…
Cancel
Save