Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Roborock S7 MaxV] Detected that custom integration 'roborock' calls async_write_ha_state #634

Open
razzietheman opened this issue May 4, 2024 · 1 comment

Comments

@razzietheman
Copy link

Logger: roborock.cloud_api
Källa: /usr/local/lib/python3.12/site-packages/roborock/api.py:326
Inträffade först: 09:26:19 (4 händelser)
Senast loggade: 09:27:37

[Roborock S7 MaxV] Detected that custom integration 'roborock' calls async_write_ha_state from a thread at custom_components/roborock/device.py, line 129: self.async_write_ha_state(). Please report it to the author of the 'roborock' custom integration.
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/roborock/api.py", line 283, in on_message_received
listener(status)
File "/config/custom_components/roborock/device.py", line 129, in _update_from_listener
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1008, in async_write_ha_state
self.hass.verify_event_loop_thread("async_write_ha_state")
File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread
frame.report(
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report
_report_integration(what, integration_frame, level, error_if_integration)
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration
raise RuntimeError(
RuntimeError: Detected that custom integration 'roborock' calls async_write_ha_state from a thread at custom_components/roborock/device.py, line 129: self.async_write_ha_state(). Please report it to the author of the 'roborock' custom integration.

@artgru
Copy link

artgru commented May 17, 2024

I've found a solution in another custom module:
https://community.home-assistant.io/t/how-to-fix-custom-integration-brematic-calls-async-write-ha-state/722238

I think it’s just updating the async_write_ha_state() to schedule_update_ha_state() since it’s not in an async function.

Just go to the device.py file in the custom_components/roborock edit the file at linve 129 and replace:
self.async_write_ha_state() => self.schedule_update_ha_state()

The error stopped appearing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants