Review suggestions

This commit is contained in:
farmio 2025-07-14 23:21:05 +02:00
parent 7a939ff393
commit 9db018957d

View File

@ -233,32 +233,42 @@ def _create_ui_light(xknx: XKNX, knx_config: ConfigType, name: str) -> XknxLight
group_address_switch_state=conf.get_state_and_passive(CONF_GA_SWITCH), group_address_switch_state=conf.get_state_and_passive(CONF_GA_SWITCH),
group_address_brightness=conf.get_write(CONF_GA_BRIGHTNESS), group_address_brightness=conf.get_write(CONF_GA_BRIGHTNESS),
group_address_brightness_state=conf.get_state_and_passive(CONF_GA_BRIGHTNESS), group_address_brightness_state=conf.get_state_and_passive(CONF_GA_BRIGHTNESS),
group_address_color=conf.get_write(CONF_COLOR, CONF_GA_COLOR) group_address_color=(
if color_dpt == LightColorMode.RGB conf.get_write(CONF_COLOR, CONF_GA_COLOR)
else None, if color_dpt == LightColorMode.RGB
group_address_color_state=conf.get_state_and_passive(CONF_COLOR, CONF_GA_COLOR) else None
if color_dpt == LightColorMode.RGB ),
else None, group_address_color_state=(
group_address_rgbw=conf.get_write(CONF_COLOR, CONF_GA_COLOR) conf.get_state_and_passive(CONF_COLOR, CONF_GA_COLOR)
if color_dpt == LightColorMode.RGBW if color_dpt == LightColorMode.RGB
else None, else None
group_address_rgbw_state=conf.get_state_and_passive(CONF_COLOR, CONF_GA_COLOR) ),
if color_dpt == LightColorMode.RGBW group_address_rgbw=(
else None, conf.get_write(CONF_COLOR, CONF_GA_COLOR)
if color_dpt == LightColorMode.RGBW
else None
),
group_address_rgbw_state=(
conf.get_state_and_passive(CONF_COLOR, CONF_GA_COLOR)
if color_dpt == LightColorMode.RGBW
else None
),
group_address_hue=conf.get_write(CONF_COLOR, CONF_GA_HUE), group_address_hue=conf.get_write(CONF_COLOR, CONF_GA_HUE),
group_address_hue_state=conf.get_state_and_passive(CONF_COLOR, CONF_GA_HUE), group_address_hue_state=conf.get_state_and_passive(CONF_COLOR, CONF_GA_HUE),
group_address_saturation=conf.get_write(CONF_COLOR, CONF_GA_SATURATION), group_address_saturation=conf.get_write(CONF_COLOR, CONF_GA_SATURATION),
group_address_saturation_state=conf.get_state_and_passive( group_address_saturation_state=conf.get_state_and_passive(
CONF_COLOR, CONF_GA_SATURATION CONF_COLOR, CONF_GA_SATURATION
), ),
group_address_xyy_color=conf.get_write(CONF_COLOR, CONF_GA_COLOR) group_address_xyy_color=(
if color_dpt == LightColorMode.XYY conf.get_write(CONF_COLOR, CONF_GA_COLOR)
else None, if color_dpt == LightColorMode.XYY
group_address_xyy_color_state=conf.get_state_and_passive( else None
CONF_COLOR, CONF_GA_COLOR ),
) group_address_xyy_color_state=(
if color_dpt == LightColorMode.XYY conf.get_state_and_passive(CONF_COLOR, CONF_GA_COLOR)
else None, if color_dpt == LightColorMode.XYY
else None
),
group_address_tunable_white=group_address_tunable_white, group_address_tunable_white=group_address_tunable_white,
group_address_tunable_white_state=group_address_tunable_white_state, group_address_tunable_white_state=group_address_tunable_white_state,
group_address_color_temperature=group_address_color_temp, group_address_color_temperature=group_address_color_temp,