bundles/infobeamer-monitor: better state dump output
This commit is contained in:
parent
713f7e02d8
commit
df8955fa35
1 changed files with 10 additions and 7 deletions
|
@ -55,14 +55,17 @@ def mqtt_out(message, level="INFO", device=None):
|
||||||
def mqtt_dump_state(device):
|
def mqtt_dump_state(device):
|
||||||
if not device["is_online"]:
|
if not device["is_online"]:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
out = []
|
||||||
|
if device["location"]:
|
||||||
|
out.append("Location: {}".format(device["location"]))
|
||||||
|
out.append("Setup: {} ({})".format(device["setup"]["name"], device["setup"]["id"]))
|
||||||
|
out.append("Resolution: {}".format(device["run"].get("resolution", "unknown")))
|
||||||
|
if not device["is_synced"]:
|
||||||
|
out.append("syncing ...")
|
||||||
|
|
||||||
mqtt_out(
|
mqtt_out(
|
||||||
"Sync status: {} - Location: {} - Running Setup: {} ({}) - Resolution: {}".format(
|
" - ".join(out),
|
||||||
"yes" if device["is_synced"] else "syncing",
|
|
||||||
device["location"],
|
|
||||||
device["setup"]["name"],
|
|
||||||
device["setup"]["id"],
|
|
||||||
device["run"].get("resolution", "unknown"),
|
|
||||||
),
|
|
||||||
device=device,
|
device=device,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue