mirror of
https://github.com/home-assistant/core.git
synced 2026-08-20 13:19:54 +01:00
The light, switch and fan services were registered with hass.services.async_register and dispatched to entities by hand, so nothing set the context and the resulting state writes were not attributed to the caller. Five of them target methods that every entity in their data key implements, so they move to async_register_platform_entity_service, which sets the context and also applies the caller's entity permissions. Their entity_id field becomes a target. The other nine only exist on some of the entities sharing a data key, which the entity service helper cannot express, so they keep their current dispatch and set the context themselves. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DQdoLT4SC1w5LUgDQA3vEq