mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Check for command topics when determinig the capabilities of an MQTT light. (#5770)
Previous code used the state topic which is obviously wrong: - The state topic is already used to select optimistic mode. - A light with only the state topic but no command topic would still announce the capability.
This commit is contained in:
parent
c7e282257a
commit
51810620fb
@ -121,12 +121,12 @@ class MqttLight(Light):
|
||||
self._state = False
|
||||
self._supported_features = 0
|
||||
self._supported_features |= (
|
||||
topic[CONF_RGB_STATE_TOPIC] is not None and SUPPORT_RGB_COLOR)
|
||||
topic[CONF_RGB_COMMAND_TOPIC] is not None and SUPPORT_RGB_COLOR)
|
||||
self._supported_features |= (
|
||||
topic[CONF_BRIGHTNESS_STATE_TOPIC] is not None and
|
||||
topic[CONF_BRIGHTNESS_COMMAND_TOPIC] is not None and
|
||||
SUPPORT_BRIGHTNESS)
|
||||
self._supported_features |= (
|
||||
topic[CONF_COLOR_TEMP_STATE_TOPIC] is not None and
|
||||
topic[CONF_COLOR_TEMP_COMMAND_TOPIC] is not None and
|
||||
SUPPORT_COLOR_TEMP)
|
||||
|
||||
for key, tpl in list(templates.items()):
|
||||
|
Loading…
x
Reference in New Issue
Block a user