Add service to clear SimpliSafe notifications (#34481)
parent
828f368323
commit
3ce89409d2
|
@ -270,6 +270,17 @@ async def async_setup_entry(hass, config_entry):
|
|||
|
||||
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_domain_control
|
||||
async def remove_pin(call):
|
||||
|
@ -311,6 +322,7 @@ async def async_setup_entry(hass, config_entry):
|
|||
return
|
||||
|
||||
for service, method, schema in [
|
||||
("clear_notifications", clear_notifications, None),
|
||||
("remove_pin", remove_pin, SERVICE_REMOVE_PIN_SCHEMA),
|
||||
("set_pin", set_pin, SERVICE_SET_PIN_SCHEMA),
|
||||
(
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"name": "SimpliSafe",
|
||||
"config_flow": true,
|
||||
"documentation": "https://www.home-assistant.io/integrations/simplisafe",
|
||||
"requirements": ["simplisafe-python==9.0.7"],
|
||||
"requirements": ["simplisafe-python==9.1.0"],
|
||||
"codeowners": ["@bachya"]
|
||||
}
|
||||
|
|
|
@ -1885,7 +1885,7 @@ simplehound==0.3
|
|||
simplepush==1.1.4
|
||||
|
||||
# homeassistant.components.simplisafe
|
||||
simplisafe-python==9.0.7
|
||||
simplisafe-python==9.1.0
|
||||
|
||||
# homeassistant.components.sisyphus
|
||||
sisyphus-control==2.2.1
|
||||
|
|
|
@ -722,7 +722,7 @@ sentry-sdk==0.13.5
|
|||
simplehound==0.3
|
||||
|
||||
# homeassistant.components.simplisafe
|
||||
simplisafe-python==9.0.7
|
||||
simplisafe-python==9.1.0
|
||||
|
||||
# homeassistant.components.sleepiq
|
||||
sleepyq==0.7
|
||||
|
|
Loading…
Reference in New Issue