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
add script shortcut for activating scenes #27223
Conversation
use `- scene: scene.<scene name>` in a script to activate a scene
@@ -885,6 +885,8 @@ def custom_serializer(schema): | |||
|
|||
DEVICE_ACTION_SCHEMA = DEVICE_ACTION_BASE_SCHEMA.extend({}, extra=vol.ALLOW_EXTRA) | |||
|
|||
_SCRIPT_SCENE_SCHEMA = vol.Schema({vol.Required("scene"): string}) |
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.
Let's validate it as entity ID for the scene domain.
_SCRIPT_SCENE_SCHEMA = vol.Schema({vol.Required("scene"): string}) | |
_SCRIPT_SCENE_SCHEMA = vol.Schema({vol.Required("scene"): entity_domain("scene")}) |
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.
Awesome! This is a great contribution 🎉 🐬
I think that we should keep it as an entity ID and not object ID, because we don't use just object ID anywhere in the codebase. |
script support added in home-assistant/core#27223
Script support added in home-assistant/core#27223
Script support added in home-assistant/core#27223
Description:
Use
- scene: scene.<scene name>
in a script to activate a scene instead of writingShould it be just
-scene: <scene name>
? Writing-scene: scene.
seems redundant.Related issue (if applicable): fixes #27026
Pull request with documentation for home-assistant.io: home-assistant/home-assistant.io#10616
Pull request for frontend: home-assistant/home-assistant-polymer#
Example entry for
configuration.yaml
(if applicable):Checklist:
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code does not interact with devices: