@@ -252,7 +252,6 @@ def __init__(
252
252
binding_key = "" ,
253
253
read_timeout : Optional [int ] = None ,
254
254
write_timeout : Optional [int ] = None ,
255
- enable_wsa : bool = False ,
256
255
) -> None :
257
256
if not _path_isfile (url ):
258
257
raise ONVIFError ("%s doesn`t exist!" % url )
@@ -297,7 +296,6 @@ def __init__(
297
296
self .ws_client : Optional [AsyncServiceProxy ] = None
298
297
self .create_type : Optional [Callable ] = None
299
298
self .loop = asyncio .get_event_loop ()
300
- self ._enable_wsa = enable_wsa
301
299
302
300
async def setup (self ):
303
301
"""Setup the transport."""
@@ -309,15 +307,11 @@ async def setup(self):
309
307
self .document = await self .loop .run_in_executor (
310
308
None , _cached_document , self .url
311
309
)
312
- # Some cameras never return a response to GetCapabilities if WS-Addressing is enabled
313
- # but some cameras require WS-Addressing to be enabled for PullPoint or events to work
314
- # so we have a flag to enable/disable it which can be changed per service.
315
- plugins = [WsAddressingPlugin ()] if self ._enable_wsa else []
316
310
self .zeep_client_authless = ZeepAsyncClient (
317
311
wsdl = self .document ,
318
312
transport = self .transport ,
319
313
settings = settings ,
320
- plugins = plugins ,
314
+ plugins = [ WsAddressingPlugin ()] ,
321
315
)
322
316
self .ws_client_authless = self .zeep_client_authless .create_service (
323
317
binding_name , self .xaddr
@@ -327,7 +321,7 @@ async def setup(self):
327
321
wsse = wsse ,
328
322
transport = self .transport ,
329
323
settings = settings ,
330
- plugins = plugins ,
324
+ plugins = [ WsAddressingPlugin ()] ,
331
325
)
332
326
self .ws_client = self .zeep_client .create_service (binding_name , self .xaddr )
333
327
namespace = binding_name [binding_name .find ("{" ) + 1 : binding_name .find ("}" )]
@@ -410,10 +404,8 @@ async def setup(self) -> ONVIFService:
410
404
#
411
405
# If this fails this is OK as it just means we will switch
412
406
# to webhook later when the first notification is received.
413
- # WSAs enabled per
414
- # https://github.com/home-assistant/core/issues/83524 https://github.com/home-assistant/core/issues/45513
415
407
service = await self ._device .create_onvif_service (
416
- "pullpoint" , port_type = "NotificationConsumer" , enable_wsa = True
408
+ "pullpoint" , port_type = "NotificationConsumer"
417
409
)
418
410
self ._operation = service .document .bindings [service .binding_name ].get (
419
411
"PullMessages"
@@ -657,7 +649,6 @@ async def create_onvif_service(
657
649
port_type : Optional [str ] = None ,
658
650
read_timeout : Optional [int ] = None ,
659
651
write_timeout : Optional [int ] = None ,
660
- enable_wsa : bool = False ,
661
652
) -> ONVIFService :
662
653
"""Create ONVIF service client"""
663
654
name = name .lower ()
@@ -696,7 +687,6 @@ async def create_onvif_service(
696
687
binding_key = binding_key ,
697
688
read_timeout = read_timeout ,
698
689
write_timeout = write_timeout ,
699
- enable_wsa = enable_wsa ,
700
690
)
701
691
await service .setup ()
702
692
@@ -725,12 +715,8 @@ async def create_deviceio_service(self) -> ONVIFService:
725
715
return await self .create_onvif_service ("deviceio" )
726
716
727
717
async def create_events_service (self ) -> ONVIFService :
728
- """Service creation helper.
729
-
730
- WSAs enabled per
731
- https://github.com/home-assistant/core/issues/83524 https://github.com/home-assistant/core/issues/45513
732
- """
733
- return await self .create_onvif_service ("events" , enable_wsa = True )
718
+ """Service creation helper."""
719
+ return await self .create_onvif_service ("events" )
734
720
735
721
async def create_analytics_service (self ) -> ONVIFService :
736
722
"""Service creation helper."""
@@ -749,38 +735,23 @@ async def create_replay_service(self) -> ONVIFService:
749
735
return await self .create_onvif_service ("replay" )
750
736
751
737
async def create_pullpoint_service (self ) -> ONVIFService :
752
- """Service creation helper.
753
-
754
- WSAs enabled per
755
- https://github.com/home-assistant/core/issues/83524 https://github.com/home-assistant/core/issues/45513
756
- """
738
+ """Service creation helper."""
757
739
return await self .create_onvif_service (
758
740
"pullpoint" ,
759
741
port_type = "PullPointSubscription" ,
760
742
read_timeout = _PULLPOINT_TIMEOUT ,
761
743
write_timeout = _PULLPOINT_TIMEOUT ,
762
- enable_wsa = True ,
763
744
)
764
745
765
746
async def create_notification_service (self ) -> ONVIFService :
766
- """Service creation helper.
767
-
768
- WSAs enabled per
769
- https://github.com/home-assistant/core/issues/83524 https://github.com/home-assistant/core/issues/45513
770
- """
771
- return await self .create_onvif_service ("notification" , enable_wsa = True )
747
+ """Service creation helper."""
748
+ return await self .create_onvif_service ("notification" )
772
749
773
750
async def create_subscription_service (
774
751
self , port_type : Optional [str ] = None
775
752
) -> ONVIFService :
776
- """Service creation helper.
777
-
778
- WSAs enabled per
779
- https://github.com/home-assistant/core/issues/83524 https://github.com/home-assistant/core/issues/45513
780
- """
781
- return await self .create_onvif_service (
782
- "subscription" , port_type = port_type , enable_wsa = True
783
- )
753
+ """Service creation helper."""
754
+ return await self .create_onvif_service ("subscription" , port_type = port_type )
784
755
785
756
async def create_receiver_service (self ) -> ONVIFService :
786
757
"""Service creation helper."""
0 commit comments