1
0
mirror of https://github.com/home-assistant/core.git synced 2026-04-02 08:26:41 +01:00

Mark Entity.async_write_ha_state as final (#166627)

This commit is contained in:
Erik Montnemery
2026-03-30 13:21:45 +02:00
committed by GitHub
parent 194485d863
commit b75af6d84a

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():