mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +00:00
Add service to clear SimpliSafe notifications (#34481)
This commit is contained in:
parent
828f368323
commit
3ce89409d2
@ -270,6 +270,17 @@ async def async_setup_entry(hass, config_entry):
|
|||||||
|
|
||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
|
@verify_system_exists
|
||||||
|
@_verify_domain_control
|
||||||
|
async def clear_notifications(call):
|
||||||
|
"""Clear all active notifications."""
|
||||||
|
system = simplisafe.systems[call.data[ATTR_SYSTEM_ID]]
|
||||||
|
try:
|
||||||
|
await system.clear_notifications()
|
||||||
|
except SimplipyError as err:
|
||||||
|
_LOGGER.error("Error during service call: %s", err)
|
||||||
|
return
|
||||||
|
|
||||||
@verify_system_exists
|
@verify_system_exists
|
||||||
@_verify_domain_control
|
@_verify_domain_control
|
||||||
async def remove_pin(call):
|
async def remove_pin(call):
|
||||||
@ -311,6 +322,7 @@ async def async_setup_entry(hass, config_entry):
|
|||||||
return
|
return
|
||||||
|
|
||||||
for service, method, schema in [
|
for service, method, schema in [
|
||||||
|
("clear_notifications", clear_notifications, None),
|
||||||
("remove_pin", remove_pin, SERVICE_REMOVE_PIN_SCHEMA),
|
("remove_pin", remove_pin, SERVICE_REMOVE_PIN_SCHEMA),
|
||||||
("set_pin", set_pin, SERVICE_SET_PIN_SCHEMA),
|
("set_pin", set_pin, SERVICE_SET_PIN_SCHEMA),
|
||||||
(
|
(
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
"name": "SimpliSafe",
|
"name": "SimpliSafe",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/simplisafe",
|
"documentation": "https://www.home-assistant.io/integrations/simplisafe",
|
||||||
"requirements": ["simplisafe-python==9.0.7"],
|
"requirements": ["simplisafe-python==9.1.0"],
|
||||||
"codeowners": ["@bachya"]
|
"codeowners": ["@bachya"]
|
||||||
}
|
}
|
||||||
|
@ -1885,7 +1885,7 @@ simplehound==0.3
|
|||||||
simplepush==1.1.4
|
simplepush==1.1.4
|
||||||
|
|
||||||
# homeassistant.components.simplisafe
|
# homeassistant.components.simplisafe
|
||||||
simplisafe-python==9.0.7
|
simplisafe-python==9.1.0
|
||||||
|
|
||||||
# homeassistant.components.sisyphus
|
# homeassistant.components.sisyphus
|
||||||
sisyphus-control==2.2.1
|
sisyphus-control==2.2.1
|
||||||
|
@ -722,7 +722,7 @@ sentry-sdk==0.13.5
|
|||||||
simplehound==0.3
|
simplehound==0.3
|
||||||
|
|
||||||
# homeassistant.components.simplisafe
|
# homeassistant.components.simplisafe
|
||||||
simplisafe-python==9.0.7
|
simplisafe-python==9.1.0
|
||||||
|
|
||||||
# homeassistant.components.sleepiq
|
# homeassistant.components.sleepiq
|
||||||
sleepyq==0.7
|
sleepyq==0.7
|
||||||
|
Loading…
x
Reference in New Issue
Block a user