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
Light implementation to control lights using individual group addresses #508
Conversation
Thanks, this would be a nice addition! 👍 |
I believe this PR is ready for review now |
I haved moved the functionality into the Light class and updated the config schemas. |
docs/light.md
Outdated
@@ -27,6 +27,24 @@ The Light object is either a representation of a binary or dimm actor, LED-contr | |||
- `group_address_tunable_white_state` KNX group address for the current relative color temperature. *DPT 5.001* | |||
- `group_address_color_temperature` KNX group address to set absolute color temperature. *DPT 7.600* | |||
- `group_address_color_temperature_state` KNX group address for the current absolute color temperature. *DPT 7.600* | |||
|
|||
- `group_address_switch_red` KNX group address to switch the red component. *DPT 1.001* | |||
- `group_address_switch_state_red` KNX group address for the state of the red component. *DPT 1.001* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we usually end with "_state" so it would be group_address_switch_red_state
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 56b88cc
docs/light.md
Outdated
print(light.supports_tunable_white) | ||
print(light.supports_color_temperature) | ||
|
||
# Requesting current state via KNX GROUP WRITE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Requesting current state via KNX GROUP WRITE | |
# Requesting current state via KNX GroupValueRead for all _state addresses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 56b88cc
vol.Optional(RED): COLOR_SCHEMA, | ||
vol.Optional(GREEN): COLOR_SCHEMA, | ||
vol.Optional(BLUE): COLOR_SCHEMA, | ||
vol.Optional(WHITE): COLOR_SCHEMA, | ||
vol.Optional(CONF_COLOR_ADDRESS): cv.string, | ||
vol.Optional(CONF_COLOR_STATE_ADDRESS): cv.string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think red green blue be in an inclusion group (optional white) and
these 3/4 in an exclusion group with color_address. https://alecthomas.github.io/voluptuous/docs/_build/html/voluptuous.html#module-voluptuous.schema_builder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 56bd1e3
I have tried to put the color addresses in an exclude group, of course without changing existing behaviour. I couldn't add the exclude to both the color and color_state addresses because it would make it impossible to use them both at the same time, as should be possible.
xknx/config/schema.py
Outdated
vol.Optional(CONF_RED): COLOR_SCHEMA, | ||
vol.Optional(CONF_GREEN): COLOR_SCHEMA, | ||
vol.Optional(CONF_BLUE): COLOR_SCHEMA, | ||
vol.Optional(CONF_WHITE): COLOR_SCHEMA, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again I think this should share an inclusion group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 56bd1e3
xknx/devices/light.py
Outdated
|
||
@property | ||
def is_on(self): | ||
"""Return if light supports color.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""Return if light supports color.""" | |
"""Return if light is on.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for your review, this must have been an error on my side
Fixed in 56b88cc
I have updated the schemas to make it possible to omit the normal switch address when the switch addresses for the individual colors are used, it is also possible to use both at the same time. Some example configs are present in the test\config_tests\resources\light folder. |
…p addresses for red, green, blue and white
…ess is present in individual_colors
Light implementation to control lights using individual group addresses for red, green, blue and white
Description
This PR adds a light implementation that makes it possible to control RGB and RGBW lights that have separate addresses for red, green, blue and white. I have made this a new class to separate it from the existing code, because the addresses needed are different and I thought it might be better to create new class instead of extending the existing class.
Fixes # (issue)
Type of change
Checklist:
example Homeassistant Configuration
it is also possible to switch all colors on/off with only one address