Add required changes to support MQTT discovery that I previously missed. See #6481.
This commit is contained in:
parent
06bc062221
commit
ddc260b628
3 changed files with 8 additions and 0 deletions
|
@ -93,6 +93,9 @@ PLATFORM_SCHEMA = mqtt.MQTT_RW_PLATFORM_SCHEMA.extend({
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||||
"""Add MQTT Light."""
|
"""Add MQTT Light."""
|
||||||
|
if discovery_info is not None:
|
||||||
|
config = PLATFORM_SCHEMA(discovery_info)
|
||||||
|
|
||||||
config.setdefault(
|
config.setdefault(
|
||||||
CONF_STATE_VALUE_TEMPLATE, config.get(CONF_VALUE_TEMPLATE))
|
CONF_STATE_VALUE_TEMPLATE, config.get(CONF_VALUE_TEMPLATE))
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||||
"""Setup a MQTT JSON Light."""
|
"""Setup a MQTT JSON Light."""
|
||||||
|
if discovery_info is not None:
|
||||||
|
config = PLATFORM_SCHEMA(discovery_info)
|
||||||
async_add_devices([MqttJson(
|
async_add_devices([MqttJson(
|
||||||
config.get(CONF_NAME),
|
config.get(CONF_NAME),
|
||||||
config.get(CONF_EFFECT_LIST),
|
config.get(CONF_EFFECT_LIST),
|
||||||
|
|
|
@ -66,6 +66,9 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||||
"""Setup a MQTT Template light."""
|
"""Setup a MQTT Template light."""
|
||||||
|
if discovery_info is not None:
|
||||||
|
config = PLATFORM_SCHEMA(discovery_info)
|
||||||
|
|
||||||
async_add_devices([MqttTemplate(
|
async_add_devices([MqttTemplate(
|
||||||
hass,
|
hass,
|
||||||
config.get(CONF_NAME),
|
config.get(CONF_NAME),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue