FalkTannhaeuser / python-onvif-zeep

ONVIF Client Implementation in Python 2+3 (using https://github.com/mvantellingen/python-zeep instead of suds as SOAP client)
MIT License
424 stars 138 forks source link

Add service for NotificationProducerBinding #37

Open monocongo opened 5 years ago

monocongo commented 5 years ago

In order to create a subscription for notification events, (I think) I need to issue a request to NotificationProducer.Subscribe.

I propose to add a new notification service in definition.py as well as a corresponding ONVIFCamera.create_notification_service function within client.py

The above will allow for something like this:

    # get the notification service we'll use for access to camera notifications
    notification_service = camera.get_service("notification")

    # subscribe for notification events
    args = {"InitialTerminationTime": "PT10M",
            "Address": f"{_LOCAL_IP_ADDRESS}:{_LISTENER_PORT}"}
    notification_service.Subscribe(args)