Add code to enable discovery for mqtt cover (#10580)

* Add code to enable discovery for mqtt cover

* Fix pylint error
This commit is contained in:
marthoc 2017-11-14 23:19:15 -05:00 committed by Paulus Schoutsen
parent 95c831d5bc
commit 309e493e76
2 changed files with 6 additions and 1 deletions

View file

@ -104,6 +104,9 @@ PLATFORM_SCHEMA = mqtt.MQTT_BASE_PLATFORM_SCHEMA.extend({
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
"""Set up the MQTT Cover."""
if discovery_info is not None:
config = PLATFORM_SCHEMA(discovery_info)
value_template = config.get(CONF_VALUE_TEMPLATE)
if value_template is not None:
value_template.hass = hass