-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Add trigger for vacuum returning to dock #158143
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
base: dev
Are you sure you want to change the base?
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -113,7 +113,7 @@ | |||||
| "title": "Vacuum", | ||||||
| "triggers": { | ||||||
| "docked": { | ||||||
| "description": "Triggers after one or more vacuums return to dock.", | ||||||
| "description": "Triggers after one or more vacuums have returned to dock.", | ||||||
| "fields": { | ||||||
| "behavior": { | ||||||
| "description": "[%key:component::vacuum::common::trigger_behavior_description%]", | ||||||
|
|
@@ -142,6 +142,16 @@ | |||||
| }, | ||||||
| "name": "Vacuum cleaner paused cleaning" | ||||||
| }, | ||||||
| "returning": { | ||||||
| "description": "Triggers after one or more vacuums begin returning to dock.", | ||||||
| "fields": { | ||||||
| "behavior": { | ||||||
| "description": "[%key:component::vacuum::common::trigger_behavior_description%]", | ||||||
| "name": "[%key:component::vacuum::common::trigger_behavior_name%]" | ||||||
| } | ||||||
| }, | ||||||
| "name": "Vacuum cleaner returning to dock" | ||||||
|
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.
Suggested change
|
||||||
| }, | ||||||
| "started_cleaning": { | ||||||
| "description": "Triggers after one or more vacuums start cleaning.", | ||||||
| "fields": { | ||||||
|
|
@@ -153,4 +163,4 @@ | |||||
| "name": "Vacuum cleaner started cleaning" | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |||||
| "docked": make_entity_state_trigger(DOMAIN, VacuumActivity.DOCKED), | ||||||
| "errored": make_entity_state_trigger(DOMAIN, VacuumActivity.ERROR), | ||||||
| "paused_cleaning": make_entity_state_trigger(DOMAIN, VacuumActivity.PAUSED), | ||||||
| "returning": make_entity_state_trigger(DOMAIN, VacuumActivity.RETURNING), | ||||||
|
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. I'm not sure about the name. The other triggers are named using past tense. We should preferably follow the same pattern here, eg
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.
Suggested change
|
||||||
| "started_cleaning": make_entity_state_trigger(DOMAIN, VacuumActivity.CLEANING), | ||||||
| } | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -47,6 +47,7 @@ async def target_vacuums(hass: HomeAssistant) -> list[str]: | |||||
| "vacuum.docked", | ||||||
| "vacuum.errored", | ||||||
| "vacuum.paused_cleaning", | ||||||
| "vacuum.returning", | ||||||
|
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.
Suggested change
|
||||||
| "vacuum.started_cleaning", | ||||||
| ], | ||||||
| ) | ||||||
|
|
@@ -86,6 +87,11 @@ async def test_vacuum_triggers_gated_by_labs_flag( | |||||
| target_states=[VacuumActivity.PAUSED], | ||||||
| other_states=other_states(VacuumActivity.PAUSED), | ||||||
| ), | ||||||
| *parametrize_trigger_states( | ||||||
| trigger="vacuum.returning", | ||||||
|
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.
Suggested change
|
||||||
| target_states=[VacuumActivity.RETURNING], | ||||||
| other_states=other_states(VacuumActivity.RETURNING), | ||||||
| ), | ||||||
| *parametrize_trigger_states( | ||||||
| trigger="vacuum.started_cleaning", | ||||||
| target_states=[VacuumActivity.CLEANING], | ||||||
|
|
@@ -153,6 +159,11 @@ async def test_vacuum_state_trigger_behavior_any( | |||||
| target_states=[VacuumActivity.PAUSED], | ||||||
| other_states=other_states(VacuumActivity.PAUSED), | ||||||
| ), | ||||||
| *parametrize_trigger_states( | ||||||
| trigger="vacuum.returning", | ||||||
|
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.
Suggested change
|
||||||
| target_states=[VacuumActivity.RETURNING], | ||||||
| other_states=other_states(VacuumActivity.RETURNING), | ||||||
| ), | ||||||
| *parametrize_trigger_states( | ||||||
| trigger="vacuum.started_cleaning", | ||||||
| target_states=[VacuumActivity.CLEANING], | ||||||
|
|
@@ -219,6 +230,11 @@ async def test_vacuum_state_trigger_behavior_first( | |||||
| target_states=[VacuumActivity.PAUSED], | ||||||
| other_states=other_states(VacuumActivity.PAUSED), | ||||||
| ), | ||||||
| *parametrize_trigger_states( | ||||||
| trigger="vacuum.returning", | ||||||
|
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.
Suggested change
|
||||||
| target_states=[VacuumActivity.RETURNING], | ||||||
| other_states=other_states(VacuumActivity.RETURNING), | ||||||
| ), | ||||||
| *parametrize_trigger_states( | ||||||
| trigger="vacuum.started_cleaning", | ||||||
| target_states=[VacuumActivity.CLEANING], | ||||||
|
|
||||||
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.