adaptive-lighting
adaptive-lighting copied to clipboard
Exception when light.turn_on/turn_off/toggle called with anything other than an entity
Version information:
adaptive-lighting 1.0.15 home-assistant 2022.3.3
Description:
In home-assistant, the light.turn_on
/light.turn_off
/light.toggle
services can be called with entities, devices, areas, or groups as the target parameter. Adaptive-lighting handles entities just fine, but if these services are called for a device or an area (probably also groups, I haven't tested that) then switch.py breaks with an exception:
Service call:
service: light.turn_on
target:
area_id: 3bd8860e5c8243339f6d4b4f7de2fc2d
Resulting exception:
2022-03-10 23:06:41 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/adaptive_lighting/switch.py", line 1257, in turn_on_off_event_listener
entity_ids = cv.ensure_list_csv(service_data[ATTR_ENTITY_ID])
KeyError: 'entity_id'
Same issue for me
Same for me. Strange is that it happens even on lights not in adaptive lightning
I fixed the problem in PR https://github.com/basnijholt/adaptive-lighting/pull/321.
I released 1.0.17 with the fix 🎉