dingo35 / ha-SmartEVSEv3

Integrate SmartEVSEv3 with HomeAssistant through custom component
13 stars 8 forks source link

Detected that custom integration 'smartevse' calls async_write_ha_state from a thread at custom_components/smartevse/number.py, line 87: self.async_write_ha_state(). #29

Closed Tigerstrength closed 4 months ago

Tigerstrength commented 4 months ago

Hi all,

First, loving this integration and using it every day to control my EV charger. It was flawless till the last HA update.

Old HA core: 2024.4 -> Working perfect New HA core 2024.5.0 -> Detected that custom integration 'smartevse' calls async_write_ha_state from a thread at custom_components/smartevse/number.py, line 87: self.async_write_ha_state(). Please report it to the author of the 'smartevse' custom integration.

Seems like it has something to do with the transition to thread safe requirements and Python 3.12 in the new HA core release. More people having this error on the latest HA core?

The probleem seems to be related to this same error: https://community.home-assistant.io/t/how-to-fix-custom-integration-brematic-calls-async-write-ha-state/722238

Where this is found to be the solution: updating the async_write_ha_state() to schedule_update_ha_state()

The API call does seem to be handled successfully, so it is just the error it throws.

Hope @dingo35 has time to look in to this? Thanks in advance!

sonar98 commented 4 months ago

I got the same problem. Changing 3 files solved it.

If @dingo35 approves the pull request it should be fixed.

dingo35 commented 4 months ago

Thanks for the bugreport @Tigerstrength , and for the PR, @sonar98 !