diff --git a/homeassistant/components/light/__init__.py b/homeassistant/components/light/__init__.py index d98d8b0d5fc5a5..18899b9282728b 100644 --- a/homeassistant/components/light/__init__.py +++ b/homeassistant/components/light/__init__.py @@ -115,10 +115,7 @@ ATTR_FLASH: vol.In([FLASH_SHORT, FLASH_LONG]), }) -LIGHT_TOGGLE_SCHEMA = vol.Schema({ - ATTR_ENTITY_ID: cv.entity_ids, - ATTR_TRANSITION: VALID_TRANSITION, -}) +LIGHT_TOGGLE_SCHEMA = LIGHT_TURN_ON_SCHEMA PROFILE_SCHEMA = vol.Schema( vol.ExactSequence((str, cv.small_float, cv.small_float, cv.byte)) diff --git a/homeassistant/components/light/services.yaml b/homeassistant/components/light/services.yaml index 8931a46bb73bd4..7770cada405738 100644 --- a/homeassistant/components/light/services.yaml +++ b/homeassistant/components/light/services.yaml @@ -82,6 +82,46 @@ toggle: description: Duration in seconds it takes to get to next state example: 60 + rgb_color: + description: Color for the light in RGB-format + example: '[255, 100, 100]' + + color_name: + description: A human readable color name + example: 'red' + + xy_color: + description: Color for the light in XY-format + example: '[0.52, 0.43]' + + color_temp: + description: Color temperature for the light in mireds (154-500) + example: '250' + + white_value: + description: Number between 0..255 indicating level of white + example: '250' + + brightness: + description: Number between 0..255 indicating brightness + example: 120 + + profile: + description: Name of a light profile to use + example: relax + + flash: + description: If the light should flash + values: + - short + - long + + effect: + description: Light effect + values: + - colorloop + - random + hue_activate_scene: description: Activate a hue scene stored in the hue hub diff --git a/homeassistant/helpers/entity.py b/homeassistant/helpers/entity.py index 0d2f56f18072dc..b331b75bd54d21 100644 --- a/homeassistant/helpers/entity.py +++ b/homeassistant/helpers/entity.py @@ -366,19 +366,20 @@ def async_turn_off(self, **kwargs): return self.hass.loop.run_in_executor( None, ft.partial(self.turn_off, **kwargs)) - def toggle(self) -> None: + def toggle(self, **kwargs) -> None: """Toggle the entity.""" if self.is_on: - self.turn_off() + self.turn_off(**kwargs) else: - self.turn_on() + self.turn_on(**kwargs) - def async_toggle(self): + def async_toggle(self, **kwargs): """Toggle the entity. This method must be run in the event loop and returns a coroutine. """ if self.is_on: - return self.async_turn_off() + return self.async_turn_off(**kwargs) else: - return self.async_turn_on() + return self.async_turn_on(**kwargs) +