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

Extend knx brightness with rgb brightness if brightness addresses are not supported #33152

Merged
merged 5 commits into from
Apr 18, 2020
Merged

Conversation

FredericMa
Copy link
Contributor

@FredericMa FredericMa commented Mar 22, 2020

Proposed change

In the documentation of the KNX light is an example to configure a RGB light. This also includes the group addresses for the brightness. My LED controllers only have color addresses (DPT 232.600) and no brightness addresses. So in this case I only configure the color addresses. The consequence is that there is no correct feedback on the set brightness on the color DPT. ALso, if I change the color, the brightness does a fallback to the default brightness (255):
https://github.com/home-assistant/home-assistant/blob/bea7aae8cd87aaef58359383d8c0ac0c34ef6abd/homeassistant/components/knx/light.py#L293-L294

The change proposed provides feedback on the brightness of the selected color and if only the color is changed, it gets the current brightness and doesn't fall back to the default brightness anymore. So 2 fixes for the price of one. 😉

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)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml for RGB without dedicated brightness addresses:
  - platform: knx
    name: Test RGB
    address: '0/5/6'
    state_address: '3/4/6'
    color_address: '0/5/7'
    color_state_address: '3/4/7'

Additional information

  • There is no issue recorded for this bug.

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
  • The code has been formatted using Black (black --fast 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 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@probot-home-assistant
Copy link

Hey there @Julius2342, mind taking a look at this pull request as its been labeled with a integration (knx) you are listed as a codeowner for? Thanks!

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Just a small adjustment.

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Found another thing.

homeassistant/components/knx/light.py Outdated Show resolved Hide resolved
@FredericMa
Copy link
Contributor Author

Thanks for checking and the clarification.
Added your changes to my system and, as expected, it still works.
Anything else I need to do for this PR at the moment?

@MartinHjelmare
Copy link
Member

MartinHjelmare commented Apr 17, 2020

I disabled the pylint warning for line 187. It seems that's a known bug in pylint.

There's another pylint error in dev at the moment though. So we can wait a bit until that's fixed. Then we can rebase so we get a clean build.

@MartinHjelmare MartinHjelmare self-assigned this Apr 17, 2020
@MartinHjelmare
Copy link
Member

Ok, I've rebased on latest dev branch. Hope this will be a clean build.

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Good!

@MartinHjelmare MartinHjelmare merged commit 2faa3af into home-assistant:dev Apr 18, 2020
@FredericMa FredericMa deleted the extend_knx_color branch April 18, 2020 19:36
@lock lock bot locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed integration: knx small-pr PRs with less than 30 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants