-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
After update zoneminder v1.37.66 if you try the simple function :
import pyzm
import pyzm.api as zmapi
import getpass
import traceback
import pyzm.ZMMemory as zmmemory
import pyzm.helpers.utils as utils
import pyzm.helpers.globals as g
print ('Using pyzm version: {}'.format(pyzm.__version__))
g.logger.set_level(2)
conf = utils.read_config('/etc/zm/secrets.ini')
api_options = {
'apiurl': utils.get(key='ZM_API_PORTAL', section='secrets', conf=conf),
'portalurl':utils.get(key='ZM_PORTAL', section='secrets', conf=conf),
'user': utils.get(key='ZM_USER', section='secrets', conf=conf),
'password':utils.get(key='ZM_PASSWORD', section='secrets', conf=conf),
'api_push_token':utils.get(key='PUSHOVER_APP_TOKEN', section='secrets', conf=conf),
'api_push_key':utils.get(key='PUSHOVER_USER_KEY', section='secrets', conf=conf),
'disable_ssl_cert_check': True,
}
zmapi = zmapi.ZMApi(options=api_options)
event_filter = {
'from': '9 am',
'to': '7 pm',
'object_only':False,
'min_alarmed_frames': 0,
'max_events':5,
}
cam_events = zmapi.events(event_filter)
print ('I got {} events'.format(len(cam_events.list())))
for e in cam_events.list():
print ('Event:{} Cause:{} Notes:{}'.format(e.name(), e.cause(), e.notes()))
the return is:
Traceback (most recent call last):
File "/home/mauro/test.py", line 37, in <module>
cam_events = zmapi.events(event_filter)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pyzm/api.py", line 368, in events
self.Events = Events(api=self, options=options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pyzm/helpers/Events.py", line 24, in __init__
self._load(options)
File "/usr/local/lib/python3.12/dist-packages/pyzm/helpers/Events.py", line 122, in _load
currevents += int(pagination.get('current'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
Metadata
Metadata
Assignees
Labels
No labels