[2/3] vacuum mqtt-discovery (#19478)

* add discoverability to mqtt-vacuum
This commit is contained in:
Tommy Jonsson authored and emontnemery committed 2019-01-06 17:05:04 +01:00
1 parent dee229152f
commit ccbc231d3a
5 files changed
+464 -226

No files matched your search

+11 -1
View File
@@ -95,7 +95,7 @@ def is_on(hass, entity_id=None):
async def async_setup(hass, config):
"""Set up the vacuum component."""
component = EntityComponent(
component = hass.data[DOMAIN] = EntityComponent(
_LOGGER, DOMAIN, hass, SCAN_INTERVAL, GROUP_NAME_ALL_VACUUMS)
await component.async_setup(config)
@@ -152,6 +152,16 @@ async def async_setup(hass, config):
return True
async def async_setup_entry(hass, entry):
"""Set up a config entry."""
return await hass.data[DOMAIN].async_setup_entry(entry)
async def async_unload_entry(hass, entry):
"""Unload a config entry."""
return await hass.data[DOMAIN].async_unload_entry(entry)
class _BaseVacuum(Entity):
"""Representation of a base vacuum.