core: Onvif camera that returns urls as bytes or an empty value instead of a string does not work with 2023.5.4

The problem

I can’t have my cams with the last update

What version of Home Assistant Core has the issue?

core-2023.5.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Onvif

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.config_entries
Source: components/onvif/event.py:316
First occurred: 08:52:01 (9 occurrences)
Last logged: 09:07:07

Error setting up entry Orlan for onvif
Error setting up entry Orlan - 78:11:dc:79:17:47 for onvif
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/onvif/__init__.py", line 40, in async_setup_entry
    await device.async_setup()
  File "/usr/src/homeassistant/homeassistant/components/onvif/device.py", line 151, in async_setup
    self.capabilities.events = await self.async_start_events()
  File "/usr/src/homeassistant/homeassistant/components/onvif/device.py", line 360, in async_start_events
    return await self.events.async_start(pull_point_support is not False, True)
  File "/usr/src/homeassistant/homeassistant/components/onvif/event.py", line 128, in async_start
    try_pullpoint and await self.pullpoint_manager.async_start()
  File "/usr/src/homeassistant/homeassistant/components/onvif/event.py", line 258, in async_start
    if not await self._async_start_pullpoint():
  File "/usr/src/homeassistant/homeassistant/components/onvif/event.py", line 296, in _async_start_pullpoint
    await self._async_create_pullpoint_subscription()
  File "/usr/local/lib/python3.10/site-packages/onvif/wrappers.py", line 37, in _async_wrap_connection_error_retry
    return await func(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/onvif/event.py", line 316, in _async_create_pullpoint_subscription
    self._pullpoint_manager = await self._device.create_pullpoint_manager(
  File "/usr/local/lib/python3.10/site-packages/onvif/client.py", line 480, in create_pullpoint_manager
    await manager.start()
  File "/usr/local/lib/python3.10/site-packages/onvif/managers.py", line 64, in start
    renewal_call_at = await self._start()
  File "/usr/local/lib/python3.10/site-packages/onvif/managers.py", line 301, in _start
    ] = normalize_url(result.SubscriptionReference.Address._value_1)
  File "/usr/local/lib/python3.10/site-packages/onvif/util.py", line 28, in normalize_url
    if "[" not in parsed.netloc and parsed.netloc.count(":") > 1:
TypeError: a bytes-like object is required, not 'str'

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 2
  • Comments: 16 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks for testing

@robbinjanssen can you try the linked PR?

cd /config
curl -o- -sSL https://gist.githubusercontent.com/bdraco/43f8043cb04b9838383fd71353e99b18/raw/core_integration_pr | bash /dev/stdin -d onvif -p 93464