angelnu / home_assistant_thethingsnetwork

TheThingsNetwork v3 integration for Home Assistant
33 stars 8 forks source link

Warning "using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state()" #17

Closed kalon33 closed 8 months ago

kalon33 commented 1 year ago

Hi,

I got the following message in home assistant log when my ttn v3 device is sending messages (for each of the entities retrieved) :

2023-05-27 15:20:42.271 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.trackit_ennio_batt (<class 'custom_components.thethingsnetwork.TTN_client.TtnDataSensor'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author.

Could you have a look for a fix? Thanks for your help.

dickeos commented 1 year ago

Plus 1 on the above problem. It seems only to happen with certain applications.

holtkamp commented 1 year ago

@kalon33 and @dickeos, does this warning message breaks the functioning of the integration, or is it just a "warning" without side-effects? I got the feeling no sensor updates are processed...

https://github.com/angelnu/home_assistant_thethingsnetwork/blob/d97db41d93a4925cee3618f0a370d47b1bfe4df8/custom_components/thethingsnetwork/TTN_client.py#L567

https://github.com/angelnu/home_assistant_thethingsnetwork/blob/d97db41d93a4925cee3618f0a370d47b1bfe4df8/custom_components/thethingsnetwork/TTN_client.py#L594

angelnu commented 8 months ago

fixed at https://github.com/angelnu/home_assistant_thethingsnetwork/commit/ccf6fb6e1086817d5c00ca86d1bc06839e056c7a