-
-
Notifications
You must be signed in to change notification settings - Fork 38.3k
Allow toggle to accept parameters #4745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,11 +115,6 @@ | |
| ATTR_FLASH: vol.In([FLASH_SHORT, FLASH_LONG]), | ||
| }) | ||
|
|
||
| LIGHT_TOGGLE_SCHEMA = vol.Schema({ | ||
| ATTR_ENTITY_ID: cv.entity_ids, | ||
| ATTR_TRANSITION: VALID_TRANSITION, | ||
| }) | ||
|
|
||
| PROFILE_SCHEMA = vol.Schema( | ||
| vol.ExactSequence((str, cv.small_float, cv.small_float, cv.byte)) | ||
| ) | ||
|
|
@@ -270,7 +265,7 @@ def async_handle_light_service(service): | |
|
|
||
| hass.services.async_register( | ||
| DOMAIN, SERVICE_TOGGLE, async_handle_light_service, | ||
| descriptions.get(SERVICE_TOGGLE), schema=LIGHT_TOGGLE_SCHEMA) | ||
| descriptions.get(SERVICE_TOGGLE), schema=LIGHT_TURN_ON_SCHEMA) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Turn on is not toggle. see above.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The point is that LIGHT_TOGGLE_SCHEMA = LIGHT_TURN_ON_SCHEMA.extend() |
||
|
|
||
| return True | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,6 +82,46 @@ toggle: | |
| description: Duration in seconds it takes to get to next state | ||
| example: 60 | ||
|
|
||
| rgb_color: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't copy stuff. Make a comment of possibility
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How should I do this? |
||
| 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 | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't remove this, extend your Schema.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied the schema from turn_on