Compare commits

...

2 Commits

Author SHA1 Message Date
Erik Montnemery
5f12d6d617 Merge branch 'dev' into entity_mark_async_write_ha_state_final 2026-03-27 07:41:05 +01:00
Erik
ffcc582aeb Mark Entity.async_write_ha_state as final 2026-03-26 20:11:12 +01:00

View File

@@ -1040,9 +1040,14 @@ class Entity(
self._async_verify_state_writable()
self._async_write_ha_state()
@final
@callback
def async_write_ha_state(self) -> None:
"""Write the state to the state machine."""
"""Write the state to the state machine.
Note: Integrations which need to customize state write should
override _async_write_ha_state, not this method.
"""
if not self.hass or not self._verified_state_writable:
self._async_verify_state_writable()
if self.hass.loop_thread_id != threading.get_ident():