8000 Fix Reolink setup when ONVIF push is unsupported by starkillerOG · Pull Request #144869 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

Fix Reolink setup when ONVIF push is unsupported #144869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2025

Conversation

starkillerOG
Copy link
Contributor

Breaking change

Proposed change

On very old Reolink models like the RLC-423, ONVIF push is not supported.
When the TCP push also fails, this could lead to the following unexpected exception blocking startup.

2025-05-10 20:10:21.209 ERROR (MainThread) [homeassistant.components.reolink] Unexpected error fetching reolink.RLC-423 data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 380, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 281, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/reolink/__init__.py", line 149, in async_device_config_update
    await host.renew()
  File "/usr/src/homeassistant/homeassistant/components/reolink/host.py", line 605, in renew
    await self._renew(SubType.push)
  File "/usr/src/homeassistant/homeassistant/components/reolink/host.py", line 636, in _renew
    await self.subscribe()
  File "/usr/src/homeassistant/homeassistant/components/reolink/host.py", line 583, in subscribe
    await self._api.subscribe(self._webhook_url)
  File "/usr/local/lib/python3.13/site-packages/reolink_aio/api.py", line 6247, in subscribe
    raise err
  File "/usr/local/lib/python3.13/site-packages/reolink_aio/api.py", line 6245, in subscribe
    response = await self.subscription_send(headers, xml)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/reolink_aio/api.py", line 6206, in subscription_send
    raise NotSupportedError(
    ...<2 lines>...
    )
reolink_aio.exceptions.NotSupportedError: Host 192.168.0.194:443: subscription request got HTTP status response 400: Bad Request with 'SOAP-ENV:Fault' as response text

This PR ensures the proper checks are in place to prevent such errors:

  • Do not renew the ONVIF push subscription while we are still waiting to see if TCP push succeeds.
  • If at a later time ONVIF push is subscribed for the first time and the response is that it is unsupported, properly mark it as unsupported so it does not keep checking and does not throw this unexpected exception.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 8000 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@joostlek joostlek merged commit 5acae7f into home-assistant:dev May 14, 2025
30 checks passed
@starkillerOG starkillerOG deleted the reolink_subscription branch May 14, 2025 10:00
@github-actions github-actions bot locked and limited conversation to collaborators May 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to set up discovered RLC-423 (unable to decrypt message with cmd_id 1, header...)
3 participants
0