Fix supported_features in MQTT fan (#28680)

* Added custom validator function for speed list

* Replace CONF_SPEED_STATE_TOPIC with CONF_SPEED_COMMAND_TOPIC to determine SUPPORT_SET_SPEED

* Revert "Added custom validator function for speed list"

This reverts commit f000396fa6.

* Replace CONF_OSCILLATION_STATE_TOPIC with CONF_OSCILLATION_COMMAND_TOPIC to determine SUPPORT_OSCILLATE
This commit is contained in:
springstan 2020-01-14 18:17:44 +01:00 committed by Paulus Schoutsen
parent 0b8a269b23
commit 297c360d04
1 changed files with 3 additions and 2 deletions

View File

@ -232,10 +232,11 @@ class MqttFan(
self._supported_features = 0
self._supported_features |= (
self._topic[CONF_OSCILLATION_STATE_TOPIC] is not None and SUPPORT_OSCILLATE
self._topic[CONF_OSCILLATION_COMMAND_TOPIC] is not None
and SUPPORT_OSCILLATE
)
self._supported_features |= (
self._topic[CONF_SPEED_STATE_TOPIC] is not None and SUPPORT_SET_SPEED
self._topic[CONF_SPEED_COMMAND_TOPIC] is not None and SUPPORT_SET_SPEED
)
async def _subscribe_topics(self):