core icon indicating copy to clipboard operation
core copied to clipboard

Update systembridgeconnector to 3.4.8 and handle optional attributes

Open timmo001 opened this issue 3 years ago • 6 comments

Proposed change

Updates connector and handles missing/optional attributes in sensor platform.

Update changelog (monorepo so not all changes are related):

https://github.com/timmo001/system-bridge/releases/tag/3.4.8 https://github.com/timmo001/system-bridge/compare/3.4.4...3.4.8 https://github.com/timmo001/system-bridge/releases

Type of change

  • [x] Dependency upgrade
  • [x] Bugfix (non-breaking change which fixes an issue)

Additional information

  • This PR is related to issue: #77731

Checklist

  • [x] The code change is tested and works locally.
  • [x] Local tests pass. Your PR cannot be merged unless tests pass
  • [x] There is no commented out code in this PR.
  • [x] I have followed the development checklist
  • [x] The code has been formatted using Black (black --fast homeassistant tests)
  • [x] Tests have been added to verify that the new code works.

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

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

The integration reached or maintains the following Integration Quality Scale:

  • [x] 🥈 Silver

To help with the load of incoming pull requests:

timmo001 avatar Oct 06 '22 14:10 timmo001

Hi,

after applying this patch manually (by replacing the sensor.py file with the version from this PR) I only get one entity "binary_sensor._new_version_available" from this integration. In the Logs I get the following error:

2022-11-12 10:21:45.073 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up system_bridge platform for sensor
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
    await asyncio.shield(task)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/system_bridge/sensor.py", line 309, in async_setup_entry
    for display in coordinator.data.display.displays:
TypeError: 'NoneType' object is not iterable

cbergmann avatar Nov 12 '22 09:11 cbergmann

I also manually updated systembridgeconnector to version 3.4.8

cbergmann avatar Nov 12 '22 09:11 cbergmann

Wrapping these lines into a if coordinator.data.display.displays is not None: fixed the problem for me. I did not look into the code how I could end up with coordinator.data.display.displays being None.

cbergmann avatar Nov 13 '22 20:11 cbergmann

Fixed conflict

timmo001 avatar Feb 11 '23 20:02 timmo001

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks :+1:

Learn more about our pull request process.

home-assistant[bot] avatar Mar 06 '23 09:03 home-assistant[bot]

Looks good to me, ready to go when you are :)

frenck avatar Mar 06 '23 17:03 frenck

Looks good to me, ready to go when you are :)

All in working order. Ready :)

timmo001 avatar Mar 07 '23 00:03 timmo001