diff --git a/tasmota/berry/examples/statedata.be b/tasmota/berry/examples/statedata.be index 756697c13..c361c89b9 100644 --- a/tasmota/berry/examples/statedata.be +++ b/tasmota/berry/examples/statedata.be @@ -17,6 +17,7 @@ class mqttdata_cls var line_highlight # Highlight latest change duration var line_highlight_color # Highlight color var line_duration # Duration option + var line_topic_is_hostname # Treat topic as hostname var list_buffer # Buffer storing lines def init() @@ -27,6 +28,7 @@ class mqttdata_cls self.line_highlight = 10 # Highlight latest change duration in seconds self.line_highlight_color = "yellow" # Highlight HTML color like "#FFFF00" or "yellow" self.line_duration = 0 # Show duration of last state message (1) + self.line_topic_is_hostname = 0 # Treat topic as hostname (1) self.list_buffer = [] # Init line buffer list @@ -150,7 +152,12 @@ class mqttdata_cls msg += format("%s%s", topic, topic, ipaddress, ipaddress) else - msg += format("%s ", topic) + if self.line_topic_is_hostname + msg += format("%s ", + topic, topic) + else + msg += format("%s ", topic) + end end if last_seen >= (now - self.line_highlight) # Highlight changes within latest seconds