rroller / dahua

Dahua Camera and Doorbell Home Assistant Integration
MIT License
405 stars 82 forks source link

fix(binary_sensor): changes async_write_ha_state method to schedule_update_ha_state in is_on() #351

Closed adutchak closed 7 months ago

adutchak commented 7 months ago

This fixes the bellow issue in HA 2024.5.0.

Failed to handle event, error: Detected that custom integration 'dahua' calls async_write_ha_state from a thread at custom_components/dahua/__init__.py, line 397: listener(). Please report it to the author of the 'dahua' custom integration., Line: 125
Failed to handle event, error: Detected that custom integration 'dahua' calls async_write_ha_state from a thread at custom_components/dahua/__init__.py, line 414: listener(). Please report it to the author of the 'dahua' custom integration., Line: 125
TECH7Fox commented 7 months ago

I'm also getting this error, and my entities are no longer updating. Would love to get this fixed.

rroller commented 7 months ago

Sorry, I've been pretty busy and just now getting to this.

rroller commented 7 months ago

Released in 0.9.52 https://github.com/rroller/dahua/releases/tag/0.9.52

TECH7Fox commented 7 months ago

Thank you! 🙏