Add service to clear SimpliSafe notifications (#34481)

pull/34462/head^2
Aaron Bach 2020-04-23 10:53:06 -06:00 committed by GitHub
parent 828f368323
commit 3ce89409d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 3 deletions

View File

@ -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),
(

View File

@ -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"]
}

View File

@ -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

View File

@ -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