Skip to content
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

Fix Address comparison / ValueReader #636

Merged
merged 4 commits into from
Mar 19, 2021
Merged

Conversation

farmio
Copy link
Member

@farmio farmio commented Mar 17, 2021

Description

Comparing GroupAddress to IndividualAddress raised a TypeError.

GroupAddress(1) == IndividualAddress(1) # raised TypeError because different types
"string" == 4 # doesn't raise anything - and so should BaseAddress

In the ValueReader we had a match-all callback for TelegramQueue so when a ValueReader was waiting for a Telegram and eg a DeviceDescriptorRead comes in the callback

if telegram.destination_address == self.group_address:

raised a TypeError and the TelegramQueue stalls (I'm not sure why - could be HA suppressing the Error)

The ValueReader now registers its GroupAddress in the TelegramQueue.Callback (and checks it again in its telegram_received function).

Fixes home-assistant/core#47735

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I have performed a self-review of my own code
  • The documentation has been adjusted accordingly
  • The changes generate no new warnings
  • Tests have been added that prove the fix is effective or that the feature works
  • The changes are documented in the changelog
  • The Homeassistant plugin has been adjusted in case of new config options

@coveralls
Copy link

coveralls commented Mar 17, 2021

Coverage Status

Coverage decreased (-0.0007%) to 94.944% when pulling 541997a on farmio:fix-value-reader into 6a9be15 on XKNX:main.

call .task_done() even when the telegram raised an exception while processing
@farmio farmio changed the title Fix value reader Fix Address comparison / ValueReader Mar 18, 2021
@farmio farmio merged commit da643dc into XKNX:main Mar 19, 2021
@farmio farmio deleted the fix-value-reader branch March 19, 2021 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KNX integration stops working
2 participants