diff --git a/custom_components/viomi_vacuum_v8/manifest.json b/custom_components/viomi_vacuum_v8/manifest.json index 2e1d9b8..b1c3c3b 100644 --- a/custom_components/viomi_vacuum_v8/manifest.json +++ b/custom_components/viomi_vacuum_v8/manifest.json @@ -1,7 +1,7 @@ { "domain": "viomi_vacuum_v8", "name": "Viomi Vacuum V8", - "version": "1.0.0", + "version": "1.2.0", "documentation": "https://github.com/tykarol/home-assistant-viomi-vacuum-v8", "requirements": [ "construct==2.10.59", diff --git a/custom_components/viomi_vacuum_v8/vacuum.py b/custom_components/viomi_vacuum_v8/vacuum.py index 24c4131..f4fa36a 100644 --- a/custom_components/viomi_vacuum_v8/vacuum.py +++ b/custom_components/viomi_vacuum_v8/vacuum.py @@ -184,14 +184,8 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= # Create handler _LOGGER.info("Initializing with host %s (token %s...)", host, token[:5]) - try: - miio_device = Device(host, token) - device_info = miio_device.info() - except DeviceException: - raise PlatformNotReady - vacuum = Vacuum(host, token) - device = ViomiVacuumRobot(name, vacuum) + device = ViomiVacuumEntity(name, vacuum) hass.data[DATA_KEY][host] = device async_add_entities([device], update_before_add=True) @@ -223,7 +217,7 @@ async def async_service_handler(service): ) -class ViomiVacuumRobot(StateVacuumEntity): +class ViomiVacuumEntity(StateVacuumEntity): """Representation of a Viomi Vacuum V8 robot.""" def __init__(self, name, vacuum):