Merge pull request #196 from mpeterson/feature/allow_optional_light_in_service_apply

Default `lights` of the `apply` service
This commit is contained in:
Bas Nijholt 2021-09-22 13:19:26 +02:00 committed by GitHub
commit a39ed33db5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -5,7 +5,7 @@ apply:
description: entity_id of the Adaptive Lighting switch.
example: switch.adaptive_lighting_default
lights:
description: entity_id(s) of lights.
description: "entity_id(s) of lights, default: lights of the switch"
example: light.bedroom_ceiling
transition:
description: Transition of the lights.

View file

@ -322,7 +322,7 @@ async def async_setup_entry(
platform.async_register_entity_service(
SERVICE_APPLY,
{
vol.Required(CONF_LIGHTS): cv.entity_ids,
vol.Optional(CONF_LIGHTS, default=switch._lights): cv.entity_ids, # pylint: disable=protected-access
vol.Optional(
CONF_TRANSITION,
default=switch._initial_transition, # pylint: disable=protected-access