SecKatie / ha-wyzeapi

Home Assistant Integration for Wyze devices.
722 stars 112 forks source link

Update sensor file #595

Closed brg468 closed 1 month ago

brg468 commented 1 month ago

Must have missed this one when adding the power sensor: https://github.com/SecKatie/ha-wyzeapi/issues/594

Also decorate the power daily sensor update method as a callback. It needs to run in the event loop since it was called from async_track_state_change_event. New error starting in 2024.5:

RuntimeError: Detected that custom integration 'wyzeapi' calls async_write_ha_state from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#async_write_ha_state at custom_components/wyzeapi/sensor.py, line 440: self.async_write_ha_state(). Please report it to the author of the 'wyzeapi' custom integration.

SecKatie commented 1 month ago

Lol I was just making the same change in #596 I will close that one in favor.