use device serial if description is not set
This commit is contained in:
parent
c084048905
commit
e55f32bfb6
1 changed files with 4 additions and 1 deletions
|
@ -40,7 +40,10 @@ def mqtt_out(message, level="INFO", device=None):
|
|||
key = "infobeamer"
|
||||
if device:
|
||||
key += f"/{device['id']}"
|
||||
message = f"[{device['description']}] {message}"
|
||||
if device["description"]:
|
||||
message = f"[{device['description']}] {message}"
|
||||
else:
|
||||
message = f"[{device['serial']}] {message}"
|
||||
|
||||
client.publish(
|
||||
CONFIG["mqtt"]["topic"],
|
||||
|
|
Loading…
Reference in a new issue