convert map to list for apprise function call

fix apprise config schema
remove apprise from required dependencies
This commit is contained in:
Pim Kunis 2023-09-23 21:33:50 +02:00 committed by pizzapim
parent 21f4266273
commit 5a989826a1
3 changed files with 16 additions and 15 deletions

View file

@ -1308,10 +1308,12 @@ properties:
- finish - finish
apprise: apprise:
type: object type: object
required: ['service_urls'] required: ['services']
additionalProperties: false additionalProperties: false
properties: properties:
services: services:
type: array
items:
type: object type: object
required: required:
- url - url

View file

@ -53,7 +53,7 @@ def ping_monitor(hook_config, config, config_filename, state, monitoring_log_lev
notify_type = state_to_notify_type[state.name.lower()] notify_type = state_to_notify_type[state.name.lower()]
apprise_object = apprise.Apprise() apprise_object = apprise.Apprise()
apprise_object.add(map(lambda service: service['url'], hook_config.get('services'))) apprise_object.add(list(map(lambda service: service['url'], hook_config.get('services'))))
if dry_run: if dry_run:
return return

View file

@ -34,8 +34,7 @@ setup(
'packaging', 'packaging',
'requests', 'requests',
'ruamel.yaml>0.15.0,<0.18.0', 'ruamel.yaml>0.15.0,<0.18.0',
'setuptools', 'setuptools'
'apprise'
), ),
extra_require={ extra_require={
"Apprise": ["apprise"] "Apprise": ["apprise"]