core/homeassistant/components/roomba/__init__.py

144 lines
4.3 KiB
Python
Raw Normal View History

"""The roomba component."""
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
import asyncio
from functools import partial
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
import logging
import async_timeout
from roombapy import RoombaConnectionError, RoombaFactory
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
from homeassistant import exceptions
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_DELAY,
CONF_HOST,
CONF_NAME,
CONF_PASSWORD,
EVENT_HOMEASSISTANT_STOP,
)
from homeassistant.core import HomeAssistant
from .const import (
BLID,
CANCEL_STOP,
CONF_BLID,
CONF_CONTINUOUS,
DOMAIN,
PLATFORMS,
ROOMBA_SESSION,
)
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
_LOGGER = logging.getLogger(__name__)
async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
"""Set the config entry up."""
# Set up roomba platforms with config entry
if not config_entry.options:
hass.config_entries.async_update_entry(
config_entry,
options={
CONF_CONTINUOUS: config_entry.data[CONF_CONTINUOUS],
CONF_DELAY: config_entry.data[CONF_DELAY],
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
},
)
roomba = await hass.async_add_executor_job(
partial(
RoombaFactory.create_roomba,
address=config_entry.data[CONF_HOST],
blid=config_entry.data[CONF_BLID],
password=config_entry.data[CONF_PASSWORD],
continuous=config_entry.options[CONF_CONTINUOUS],
delay=config_entry.options[CONF_DELAY],
)
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
)
try:
if not await async_connect_or_timeout(hass, roomba):
return False
except CannotConnect as err:
raise exceptions.ConfigEntryNotReady from err
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
async def _async_disconnect_roomba(event):
await async_disconnect_or_timeout(hass, roomba)
cancel_stop = hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, _async_disconnect_roomba
)
hass.data.setdefault(DOMAIN, {})
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
hass.data[DOMAIN][config_entry.entry_id] = {
ROOMBA_SESSION: roomba,
BLID: config_entry.data[CONF_BLID],
CANCEL_STOP: cancel_stop,
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
}
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
if not config_entry.update_listeners:
config_entry.add_update_listener(async_update_options)
return True
async def async_connect_or_timeout(hass, roomba):
"""Connect to vacuum."""
try:
name = None
2021-11-04 15:07:50 +00:00
async with async_timeout.timeout(10):
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
_LOGGER.debug("Initialize connection to vacuum")
await hass.async_add_executor_job(roomba.connect)
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
while not roomba.roomba_connected or name is None:
# Waiting for connection and check datas ready
name = roomba_reported_state(roomba).get("name", None)
if name:
break
await asyncio.sleep(1)
except RoombaConnectionError as err:
_LOGGER.debug("Error to connect to vacuum: %s", err)
raise CannotConnect from err
except asyncio.TimeoutError as err:
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
# api looping if user or password incorrect and roomba exist
await async_disconnect_or_timeout(hass, roomba)
_LOGGER.debug("Timeout expired: %s", err)
raise CannotConnect from err
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
return {ROOMBA_SESSION: roomba, CONF_NAME: name}
async def async_disconnect_or_timeout(hass, roomba):
"""Disconnect to vacuum."""
_LOGGER.debug("Disconnect vacuum")
2021-11-04 15:07:50 +00:00
async with async_timeout.timeout(3):
await hass.async_add_executor_job(roomba.disconnect)
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
return True
async def async_update_options(hass: HomeAssistant, config_entry: ConfigEntry) -> None:
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
"""Update options."""
await hass.config_entries.async_reload(config_entry.entry_id)
async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
"""Unload a config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(
config_entry, PLATFORMS
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
)
if unload_ok:
domain_data = hass.data[DOMAIN][config_entry.entry_id]
domain_data[CANCEL_STOP]()
Add config_flow for Roomba (#33302) * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * Add config_flow for roomba * Get options to connect * Fix options in config flow * Fix syntax in config_flow * Remove name (not necessary) * Add bin sensor * Add Battery sensor * Add async_connect * Fix typo * Add Model and Software version * Update Roombapy 1.5.0 * Add validate_input * Add connect and disconnect functions * Remove test config flow * Add variables after loop * Fix translate * Fix typo * Fix state of bin * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove invalid auth * Add call function reported_state * Add options reload * Fix tracelog * Set entry_id for config_entry * Fix DOMAIN unsed-import * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/config_flow.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add unique_id for entry * Fix device info * syntax for mac (pyupgrade) * Change single key to BLID * Resolve dict conflict * Update homeassistant/components/roomba/binary_sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/.translations/en.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/strings.json Co-Authored-By: J. Nick Koston <nick@koston.org> * Add description * Revert "Remove test config flow" This reverts commit 26a89422e89d7c88dd3c0ec3066e607afdc99f09. * Add tests * Remove check if user none * Replace CONF_USERNAME to CONF_BLID (breaking change) * Update test_config_flow.py * Add code owners * Remove CONF_USERNAME (unused) * Add multiple vacuum * Add multiple vacuum * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Fix syntax name * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Remove CONF_PREFIX (unused) * Update homeassistant/components/roomba/sensor.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Add import UNIT_PERCENTAGE * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> * Update homeassistant/components/roomba/__init__.py Co-Authored-By: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 15:55:00 +00:00
await async_disconnect_or_timeout(hass, roomba=domain_data[ROOMBA_SESSION])
hass.data[DOMAIN].pop(config_entry.entry_id)
return unload_ok
def roomba_reported_state(roomba):
"""Roomba report."""
return roomba.master_state.get("state", {}).get("reported", {})
class CannotConnect(exceptions.HomeAssistantError):
"""Error to indicate we cannot connect."""