Allow light toggle service to accept all turn on params#20912
Merged
fabaff merged 1 commit intoMar 7, 2019
Merged
Conversation
2 tasks
Contributor
Author
|
Added docs PR. |
|
Tested and works for me! Solved the problem of me having to have separate automations for Thanks. |
dgomes
approved these changes
Mar 7, 2019
dgomes
requested changes
Mar 7, 2019
| ATTR_ENTITY_ID: cv.comp_entity_ids, | ||
| ATTR_TRANSITION: VALID_TRANSITION, | ||
| }) | ||
| LIGHT_TOGGLE_SCHEMA = LIGHT_TURN_ON_SCHEMA |
Contributor
There was a problem hiding this comment.
On a second look, do all attributes of LIGHT_TURN_ON_SCHEMA make sense ? Shouldn't it be a subset ?
Contributor
Author
There was a problem hiding this comment.
Under the hood it calls turn_on, so I think everything that is accepted by turn_on could be passed there https://github.com/home-assistant/home-assistant/blob/519315f9c82ba9f0ea0bdcc622b4952b1c0a605c/homeassistant/helpers/entity.py#L470
dgomes
approved these changes
Mar 7, 2019
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Looks like toggle service now accepts kwargs. Wanted to retry this PR. Ability to use service light.toggle to turn on light with specified brightness / color etc. It allow for easier scripting, than writing own toggle method, to toggle with specific settings.
Related issue (if applicable): fixes #
**Pull request in home-assistant.io with home-assistant/home-assistant.io#8612
Checklist:
tox. Your PR cannot be merged unless tests pass