Add required changes to support MQTT discovery that I previously missed. See #6481.

This commit is contained in:
Robbie Trencheny 2017-03-08 23:57:54 -08:00
parent 06bc062221
commit ddc260b628
3 changed files with 8 additions and 0 deletions

View file

@ -93,6 +93,9 @@ PLATFORM_SCHEMA = mqtt.MQTT_RW_PLATFORM_SCHEMA.extend({
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
"""Add MQTT Light."""
if discovery_info is not None:
config = PLATFORM_SCHEMA(discovery_info)
config.setdefault(
CONF_STATE_VALUE_TEMPLATE, config.get(CONF_VALUE_TEMPLATE))

View file

@ -72,6 +72,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
"""Setup a MQTT JSON Light."""
if discovery_info is not None:
config = PLATFORM_SCHEMA(discovery_info)
async_add_devices([MqttJson(
config.get(CONF_NAME),
config.get(CONF_EFFECT_LIST),

View file

@ -66,6 +66,9 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
"""Setup a MQTT Template light."""
if discovery_info is not None:
config = PLATFORM_SCHEMA(discovery_info)
async_add_devices([MqttTemplate(
hass,
config.get(CONF_NAME),