bundles/infobeamer-monitor: more alerts

This commit is contained in:
Franzi 2023-12-26 23:15:18 +01:00
parent 9be370f8df
commit 14c01e3bf0
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -98,9 +98,7 @@ while True:
) )
) )
mqtt_out( mqtt_out(
'new device found with name "{}"!'.format( 'new device found!',
device["description"]
),
device=device, device=device,
) )
if device["is_online"]: if device["is_online"]:
@ -123,6 +121,10 @@ while True:
if device["is_online"]: if device["is_online"]:
must_dump_state = True must_dump_state = True
if device["description"] != state[did]["description"]:
LOG.info("device {} changed name to {}".format(did, device["description"]))
must_dump_state = True
if device["is_online"]: if device["is_online"]:
if device["maintenance"]: if device["maintenance"]:
mqtt_out( mqtt_out(
@ -137,7 +139,7 @@ while True:
if ( if (
device["is_synced"] != state[did]["is_synced"] device["is_synced"] != state[did]["is_synced"]
or device["location"] != state[did]["location"] or device["location"] != state[did]["location"]
or device["setup"]["name"] != state[did]["setup"]["name"] or device["setup"]["id"] != state[did]["setup"]["id"]
or device["run"].get("resolution") or device["run"].get("resolution")
!= state[did]["run"].get("resolution") != state[did]["run"].get("resolution")
): ):