N4S4 / synology-api

A Python wrapper around Synology API
MIT License
398 stars 145 forks source link

query_event_list_by_filter: rename camera id filtering parameter #162

Closed fabtesta closed 8 months ago

fabtesta commented 8 months ago

Method optional parameter "cameraId" in method query_event_list_by_filter was renamed in "cameraIds" as expected by Synology APIs. Code to test the change:

now = datetime.datetime.now()
today_midnight = datetime.datetime(now.year, now.month, now.day)

# not filtered by camera id
camera_events_response = ss.query_event_list_by_filter(limit=100, fromTime=int(today_midnight.timestamp()))
camera_events = camera_events_response['data']['recordings']
self.assertIsNotNone(camera_events )
self.assertEqual(events.__len__(), 100)

# filtered by camera id
camera_events_response = ss.query_event_list_by_filter(limit=100, cameraIds=camera_id,
                                                           fromTime=int(today_midnight .timestamp()))
camera_events = camera_events_response['data']['recordings']
self.assertIsNotNone(camera_events )
self.assertEqual(events.__len__(), 12)
N4S4 commented 8 months ago

Ciao @fabtesta, thank you for helping! I just wanted to ask a couple of questions before I publish a new release. Do you have any issue in the login process as described in #159 Could I ask also if with latest commit are u able to upload a file with filestation?

thank you in advance if you can help

fabtesta commented 8 months ago

Ciao @fabtesta, thank you for helping! I just wanted to ask a couple of questions before I publish a new release. Do you have any issue in the login process as described in #159 Could I ask also if with latest commit are u able to upload a file with filestation?

thank you in advance if you can help

Absolutely glad to help. Let me try the case and I'll comment the issue.