MQTT discovery (#5724)
* Change implementation * Re-write * Remove unused consts * Update discovery.py * Add tests * fix other tests * Fix check_config script test * Lint * Lint
This commit is contained in:
parent
45507cd9d1
commit
c7fd28c10f
7 changed files with 213 additions and 11 deletions
|
@ -36,7 +36,10 @@ PLATFORM_SCHEMA = mqtt.MQTT_RO_PLATFORM_SCHEMA.extend({
|
|||
|
||||
# pylint: disable=unused-argument
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Setup the MQTT binary sensor."""
|
||||
"""Set up the MQTT binary sensor."""
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue