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

Passive / Listening group addresses from Lists of group_addresses #634

Merged
merged 6 commits into from Mar 16, 2021

Conversation

farmio
Copy link
Member

@farmio farmio commented Mar 15, 2021

Description

Passive / Listening group addresses from Lists of group_addresses. This can be used for all functions without breaking changes.

Group address configuration behaves like in ETS where the first is the "sending" address and others are just for updating the communication object.

light = Light(
    xknx, 
    name="light with passive address",
    group_address_switch=["1/2/3", "1/2/10", "1/2/20"]
    group_address_switch_state=["1/3/3", "1/3/10", "1/3/20"]
    )
assert light.switch.group_address == GroupAddress("1/2/3")
assert light.switch.group_address_state == GroupAddress("1/3/3")
assert light.switch.passive_group_addresses == [
    GroupAddress("1/2/10"),
    GroupAddress("1/2/20"),
    GroupAddress("1/3/10"),
    GroupAddress("1/3/20"),
    ]

Removed currently unused RemoteValue.passive_group_addresses attribute in favor of unpacking from RemoteValue.group_address and RemoteValue.group_address_state.

It is not (yet) possible to define a RemoteValue with only passive addresses - not sure if this is useful. It would be equal to configure state_address and set sync_state to False.

Fixes # (issue)

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

@farmio farmio requested a review from marvin-w March 15, 2021 07:44
@coveralls
Copy link

coveralls commented Mar 15, 2021

Coverage Status

Coverage increased (+0.0007%) to 94.945% when pulling 5bd6b98 on farmio:passive-from-list into a50e930 on XKNX:main.

@Tolriq
Copy link

Tolriq commented Mar 15, 2021

I suppose that this will break my script with:
xknx.devices[cover_attributes['friendly_name']].updown.passive_group_addresses and I'll need to update?

If so how can I follow in advance what version of HA will include the change? HA changelog never refer directly to xknx versions :(

@farmio
Copy link
Member Author

farmio commented Mar 15, 2021

@Tolriq this will work as before. Just the option to define passive_group_addressesin __init__ is removed - the attribute itself is still there.
You will, however be able to just define this in the yaml configuration of HA.

In HA changelogs every dependency upgrade is listed. This will also require an update to the integration so it will also have an extra PR there. It will probably not be a breaking change...

@Tolriq
Copy link

Tolriq commented Mar 15, 2021

Ok thanks, still learning, but now that I have most in prod, I'm more cautious to avoid WAF issues :)

Copy link
Member

@marvin-w marvin-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice to me.

Splitting it into multiple commits would have made the review easier.

@farmio farmio merged commit 9ee51d7 into XKNX:main Mar 16, 2021
@farmio farmio deleted the passive-from-list branch March 16, 2021 14:57
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.

None yet

4 participants