mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 18:39:30 +00:00
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:
committed by
Paulus Schoutsen
parent
45507cd9d1
commit
c7fd28c10f
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user