Closed bdraco closed 2 months ago
This works as expected
need to push it to my other system for testing so I have it tested on two systems first
73 writes/min, down from 1000s
down to 78 on the other instance, nice!
Do we need to bump the minimum ha version too?
No need to bump the minimum version. It's more than new enough with this design
https://github.com/alandtse/tesla/pull/953 didn't work because the data is actually a
bool
. This is a second attempt948 made me realize that the car data was being polled far less frequently than I thought as the underlying library was caching, but every time the coordinator fired, it would still callback all the listeners and write the state of all the entities which meant we ended up writing state every 10 seconds even if nothing has changed.
Keep track of when the controller was last updated in each entity and if it has not changed, we skip the state write.
This reduced the number of calls to
async_write_ha_state
by 62% on my production HA instance!