From 46fa6cabe1d016ca35fb54312666d7d4eb95fe0b Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 7 Sep 2025 14:56:20 +0200 Subject: [PATCH] Add highlight for last changed devices --- tasmota/berry/examples/statedata.be | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tasmota/berry/examples/statedata.be b/tasmota/berry/examples/statedata.be index 0fcce9851..756697c13 100644 --- a/tasmota/berry/examples/statedata.be +++ b/tasmota/berry/examples/statedata.be @@ -14,6 +14,8 @@ class mqttdata_cls var line_option # Line option var line_cnt # Number of lines var line_teleperiod # Skip any device taking longer to respond (probably offline) + var line_highlight # Highlight latest change duration + var line_highlight_color # Highlight color var line_duration # Duration option var list_buffer # Buffer storing lines @@ -21,7 +23,9 @@ class mqttdata_cls # self.line_option = 1 # Scroll line_cnt lines self.line_option = 2 # Show devices updating within line_teleperiod self.line_cnt = 10 # Option 1 number of lines to show - self.line_teleperiod = 1200 # Option 2 number of teleperiod for devices to be shown + self.line_teleperiod = 1200 # Option 2 number of teleperiod seconds for devices to be shown + 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.list_buffer = [] # Init line buffer list @@ -107,7 +111,8 @@ class mqttdata_cls def web_sensor() if self.list_buffer.size() - var time_window = tasmota.rtc('local') - self.line_teleperiod + var now = tasmota.rtc('local') + var time_window = now - self.line_teleperiod var list_index = 0 var list_size = size(self.list_buffer) while list_index < list_size @@ -147,7 +152,13 @@ class mqttdata_cls else msg += format("