Adds MQTT Fan Discovery (#9463)
This commit is contained in:
1 parent
bda6d2c696
commit
8a3f8457e8
3 files changed
+22
-1
No files matched your search
@@ -78,6 +78,9 @@ PLATFORM_SCHEMA = mqtt.MQTT_RW_PLATFORM_SCHEMA.extend({
|
||||
@asyncio.coroutine
|
||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
"""Set up the MQTT fan platform."""
|
||||
if discovery_info is not None:
|
||||
config = PLATFORM_SCHEMA(discovery_info)
|
||||
|
||||
async_add_devices([MqttFan(
|
||||
config.get(CONF_NAME),
|
||||
{
|
||||
|
||||
@@ -20,10 +20,11 @@ TOPIC_MATCHER = re.compile(
|
||||
r'(?P<prefix_topic>\w+)/(?P<component>\w+)/'
|
||||
r'(?:(?P<node_id>[a-zA-Z0-9_-]+)/)?(?P<object_id>[a-zA-Z0-9_-]+)/config')
|
||||
|
||||
SUPPORTED_COMPONENTS = ['binary_sensor', 'light', 'sensor', 'switch']
|
||||
SUPPORTED_COMPONENTS = ['binary_sensor', 'fan', 'light', 'sensor', 'switch']
|
||||
|
||||
ALLOWED_PLATFORMS = {
|
||||
'binary_sensor': ['mqtt'],
|
||||
'fan': ['mqtt'],
|
||||
'light': ['mqtt', 'mqtt_json', 'mqtt_template'],
|
||||
'sensor': ['mqtt'],
|
||||
'switch': ['mqtt'],
|
||||
|
||||
Reference in new issue
Block a user