sleevezipper / hass-workstation-service

Provide useful sensors and services from your workstation to Home Assistant.
Apache License 2.0
613 stars 54 forks source link

Changed LastActive precision to 1 second. #156

Closed Inrego closed 2 years ago

Inrego commented 2 years ago

The precision was a bit off. The miliseconds kept changing on each update-interval, even with no activity. See this update timeline in HA with update interval set to 10 seconds (this is just a 5 minute snippet of the timeline during the night): image New value on every update. The state value is the same, except for the miliseconds (since there was no activity during this period).

I changed the code to only change the reported value if it changed by more than 1 second. I believe this helps towards the intented use case for this sensor. Now, you should be able to make automations on value changed of this sensor.

sleevezipper commented 2 years ago

That looks great, thank you!