Skip to content

Commit

Permalink
update to zeep 3.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
rbtying committed Jun 13, 2023
1 parent 4b775f4 commit bdd08b4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions custom_components/onvif_ptz/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ async def async_setup_profiles(self):

try:
await device.update_xaddrs()
device_mgmt = device.create_devicemgmt_service()
device_mgmt = await device.create_devicemgmt_service()

# Get the MAC address to use as the unique ID for the config flow
if not self.device_id:
Expand Down Expand Up @@ -223,7 +223,7 @@ async def async_setup_profiles(self):
)

# Verify there is support for PTZ
ptz_service = device.create_ptz_service()
ptz_service = await device.create_ptz_service()
nodes = await ptz_service.GetNodes()

if not nodes:
Expand Down
18 changes: 9 additions & 9 deletions custom_components/onvif_ptz/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async def async_setup(self) -> bool:
return False

if self.capabilities.ptz:
self.device.create_ptz_service()
await self.device.create_ptz_service()

except RequestError as err:
LOGGER.warning(
Expand Down Expand Up @@ -133,7 +133,7 @@ async def async_stop(self, event=None):

async def async_manually_set_date_and_time(self) -> None:
"""Set Date and Time Manually using SetSystemDateAndTime command."""
device_mgmt = self.device.create_devicemgmt_service()
device_mgmt = await self.device.create_devicemgmt_service()

# Retrieve DateTime object from camera to use as template for Set operation
device_time = await device_mgmt.GetSystemDateAndTime()
Expand All @@ -160,7 +160,7 @@ async def async_manually_set_date_and_time(self) -> None:
async def async_check_date_and_time(self) -> None:
"""Warns if device and system date not synced."""
LOGGER.debug("Setting up the ONVIF device management service")
device_mgmt = self.device.create_devicemgmt_service()
device_mgmt = await self.device.create_devicemgmt_service()

LOGGER.debug("Retrieving current device date/time")
try:
Expand Down Expand Up @@ -230,7 +230,7 @@ async def async_check_date_and_time(self) -> None:

async def async_get_device_info(self) -> DeviceInfo:
"""Obtain information about this device."""
device_mgmt = self.device.create_devicemgmt_service()
device_mgmt = await self.device.create_devicemgmt_service()
device_info = await device_mgmt.GetDeviceInformation()

# Grab the last MAC address for backwards compatibility
Expand Down Expand Up @@ -269,7 +269,7 @@ async def async_get_capabilities(self):

async def async_get_profiles(self) -> list[Profile]:
"""Obtain PTZ nodes for this device."""
media_service = self.device.create_media_service()
media_service = await self.device.create_media_service()
result = await media_service.GetProfiles()
profiles: list[Profile] = []

Expand Down Expand Up @@ -311,7 +311,7 @@ async def async_perform_ptz_stop(
LOGGER.warning("Stop not supported on device '%s'", self.name)
return

ptz_service = self.device.create_ptz_service()
ptz_service = await self.device.create_ptz_service()
try:
req = ptz_service.create_type("Stop")
req.ProfileToken = profile.token
Expand All @@ -334,7 +334,7 @@ async def async_perform_ptz_absolute(
speed=None,
):
"""Perform a AbsoluteMove PTZ action on the camera."""
ptz_service = self.device.create_ptz_service()
ptz_service = await self.device.create_ptz_service()

LOGGER.debug(
"Calling AbsoluteMove PTZ: position: %s speed: %s", position, speed
Expand Down Expand Up @@ -362,7 +362,7 @@ async def async_perform_ptz_continuous(
velocity,
):
"""Perform a AbsoluteMove PTZ action on the camera."""
ptz_service = self.device.create_ptz_service()
ptz_service = await self.device.create_ptz_service()

LOGGER.debug("Calling ContinousMove PTZ: velocity: %s", velocity)
try:
Expand All @@ -388,7 +388,7 @@ async def async_perform_ptz_relative(
speed=None,
):
"""Perform a RelativeMove PTZ action on the camera."""
ptz_service = self.device.create_ptz_service()
ptz_service = await self.device.create_ptz_service()

LOGGER.debug(
"Calling RelativeMove PTZ: translation: %s speed: %s", translation, speed
Expand Down
6 changes: 3 additions & 3 deletions custom_components/onvif_ptz/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"iot_class": "local_polling",
"issue_tracker": "https://github.com/rbtying/hass-onvif-ptz/issues",
"requirements": [
"onvif-zeep-async==1.2.1",
"onvif-zeep-async==3.1.9",
"WSDiscovery==2.0.0"
],
"version": "0.0.0"
}
"version": "0.2.0"
}

0 comments on commit bdd08b4

Please sign in to comment.