dawidchyrzynski / arduino-home-assistant

ArduinoHA allows to integrate an Arduino/ESP based device with Home Assistant using MQTT.
https://dawidchyrzynski.github.io/arduino-home-assistant/
GNU Affero General Public License v3.0
485 stars 116 forks source link

Sensor update #80

Closed netmindz closed 2 years ago

netmindz commented 2 years ago

Only publish when value changes, as the BinarySensor does, but for Sensor

netmindz commented 2 years ago

sorry, hang fire, it's not always updating when it should. Can you see what i've done wrong?

netmindz commented 2 years ago

@dawidchyrzynski Can you see what I'm doing wrong in the code? Looks like it should be ok, it's pretty simple but not working as intended and makes my code way simplier if i can just always call setValue like I do for the boolean version in my loop rather than keeping state tracking of all my different state values in my main project or else be spamming MQTT with the same values many times per second