mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Add debug mode to catch unsafe thread operations using core helpers (#115390)
* adjust * adjust * fixes * one more * test * debug * move to config * cover * Update homeassistant/core.py * set debug from RuntimeConfig * reduce * fix message * raise * Update homeassistant/core.py * Update homeassistant/core.py * no flood check for raise * cover
This commit is contained in:
@@ -971,6 +971,8 @@ class Entity(
|
||||
"""Write the state to the state machine."""
|
||||
if self.hass is None:
|
||||
raise RuntimeError(f"Attribute hass is None for {self}")
|
||||
if self.hass.config.debug:
|
||||
self.hass.verify_event_loop_thread("async_write_ha_state")
|
||||
|
||||
# The check for self.platform guards against integrations not using an
|
||||
# EntityComponent and can be removed in HA Core 2024.1
|
||||
|
||||
Reference in New Issue
Block a user