Skip to content

Commit

Permalink
skip events with eventType None
Browse files Browse the repository at this point in the history
  • Loading branch information
maciej-or committed Jul 26, 2023
1 parent c649eb1 commit 6b83954
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/hikvision_next/isapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,11 @@ async def get_supported_events_info(self):

for support_event in supported_events:
notifications = support_event.get("EventTriggerNotificationList", {})
event_type = support_event.get("eventType")
# Fix for empty EventTriggerNotificationList in IP camera
if not notifications:
if not notifications or not event_type:
continue

event_type = support_event.get("eventType")
channel = support_event.get("videoInputChannelID", support_event.get("dynVideoInputChannelID", 0))
io_port = support_event.get("inputIOPortID", support_event.get("dynInputIOPortID", 0))
notifications = notifications.get("EventTriggerNotification", [])
Expand Down

0 comments on commit 6b83954

Please sign in to comment.