mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 22:07:10 +00:00
Blueprint: descriptions + descriptive errors (#43899)
This commit is contained in:
parent
78a69ef284
commit
262e77d969
@ -1,5 +1,6 @@
|
|||||||
blueprint:
|
blueprint:
|
||||||
name: Motion-activated Light
|
name: Motion-activated Light
|
||||||
|
description: Turn on a light when motion is detected.
|
||||||
domain: automation
|
domain: automation
|
||||||
source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/motion_light.yaml
|
source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/motion_light.yaml
|
||||||
input:
|
input:
|
||||||
@ -17,7 +18,7 @@ blueprint:
|
|||||||
domain: light
|
domain: light
|
||||||
no_motion_wait:
|
no_motion_wait:
|
||||||
name: Wait time
|
name: Wait time
|
||||||
description: Time to wait until the light should be turned off.
|
description: Time to leave the light on after last motion is detected.
|
||||||
default: 120
|
default: 120
|
||||||
selector:
|
selector:
|
||||||
number:
|
number:
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
blueprint:
|
blueprint:
|
||||||
name: Send notification when a person leaves a zone
|
name: Zone Notification
|
||||||
|
description: Send a notification to a device when a person leaves a specific zone.
|
||||||
domain: automation
|
domain: automation
|
||||||
source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/notify_leaving_zone.yaml
|
source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/notify_leaving_zone.yaml
|
||||||
input:
|
input:
|
||||||
@ -26,6 +27,7 @@ trigger:
|
|||||||
|
|
||||||
variables:
|
variables:
|
||||||
zone_entity: !input zone_entity
|
zone_entity: !input zone_entity
|
||||||
|
# This is the state of the person when it's in this zone.
|
||||||
zone_state: "{{ states[zone_entity].name }}"
|
zone_state: "{{ states[zone_entity].name }}"
|
||||||
person_entity: !input person_entity
|
person_entity: !input person_entity
|
||||||
person_name: "{{ states[person_entity].name }}"
|
person_name: "{{ states[person_entity].name }}"
|
||||||
|
@ -124,7 +124,9 @@ def _extract_blueprint_from_community_topic(
|
|||||||
break
|
break
|
||||||
|
|
||||||
if blueprint is None:
|
if blueprint is None:
|
||||||
raise HomeAssistantError("No valid blueprint found in the topic")
|
raise HomeAssistantError(
|
||||||
|
"No valid blueprint found in the topic. Blueprint syntax blocks need to be marked as YAML or no syntax."
|
||||||
|
)
|
||||||
|
|
||||||
return ImportedBlueprint(
|
return ImportedBlueprint(
|
||||||
f'{post["username"]}/{topic["slug"]}', block_content, blueprint
|
f'{post["username"]}/{topic["slug"]}', block_content, blueprint
|
||||||
@ -204,7 +206,9 @@ async def fetch_blueprint_from_github_gist_url(
|
|||||||
break
|
break
|
||||||
|
|
||||||
if blueprint is None:
|
if blueprint is None:
|
||||||
raise HomeAssistantError("No valid blueprint found in the gist")
|
raise HomeAssistantError(
|
||||||
|
"No valid blueprint found in the gist. The blueprint file needs to end with '.yaml'"
|
||||||
|
)
|
||||||
|
|
||||||
return ImportedBlueprint(
|
return ImportedBlueprint(
|
||||||
f"{gist['owner']['login']}/{filename[:-5]}", content, blueprint
|
f"{gist['owner']['login']}/{filename[:-5]}", content, blueprint
|
||||||
|
Loading…
x
Reference in New Issue
Block a user