CONF_NAME, CONF_TOKEN, STATE_OFF, STATE_ON, ) import homeassistant.helpers.config_validation as cv _LOGGER = logging.getLogger(__name__) DEFAULT_NAME = "Xiaomi Vacuum cleaner STYJ02YM" DATA_KEY = "vacuum.miio2" PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { vol.Required(CONF_HOST): cv.string, vol.Required(CONF_TOKEN): vol.All(str, vol.Length(min=32, max=32)), vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, }, extra=vol.ALLOW_EXTRA, ) VACUUM_SERVICE_SCHEMA = vol.Schema( {vol.Optional(ATTR_ENTITY_ID): cv.comp_entity_ids}) SERVICE_CLEAN_ZONE = "xiaomi_clean_zone" SERVICE_CLEAN_POINT = "xiaomi_clean_point" ATTR_ZONE_ARRAY = "zone" ATTR_ZONE_REPEATER = "repeats" ATTR_POINT = "point" SERVICE_SCHEMA_CLEAN_ZONE = VACUUM_SERVICE_SCHEMA.extend({ vol.Required(ATTR_ZONE_ARRAY): vol.All( list,
DEFAULT_CONTINUOUS = True DEFAULT_NAME = 'Roomba' ICON = 'mdi:roomba' PLATFORM = 'roomba' FAN_SPEED_AUTOMATIC = 'Automatic' FAN_SPEED_ECO = 'Eco' FAN_SPEED_PERFORMANCE = 'Performance' FAN_SPEEDS = [FAN_SPEED_AUTOMATIC, FAN_SPEED_ECO, FAN_SPEED_PERFORMANCE] PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Required(CONF_HOST): cv.string, vol.Required(CONF_USERNAME): cv.string, vol.Required(CONF_PASSWORD): cv.string, vol.Optional(CONF_CERT, default=DEFAULT_CERT): cv.string, vol.Optional(CONF_CONTINUOUS, default=DEFAULT_CONTINUOUS): cv.boolean, }, extra=vol.ALLOW_EXTRA) # Commonly supported features SUPPORT_ROOMBA = SUPPORT_BATTERY | SUPPORT_PAUSE | SUPPORT_RETURN_HOME | \ SUPPORT_SEND_COMMAND | SUPPORT_STATUS | SUPPORT_STOP | \ SUPPORT_TURN_OFF | SUPPORT_TURN_ON # Only Roombas with CarpetBost can set their fanspeed SUPPORT_ROOMBA_CARPET_BOOST = SUPPORT_ROOMBA | SUPPORT_FAN_SPEED @asyncio.coroutine
_LOGGER = logging.getLogger(__name__) ATTR_ERROR = 'error' DEFAULT_NAME = 'RoboVac' PLATFORM = 'eufyrobovac' FAN_SPEED_NORMAL = '0' FAN_SPEED_MAX = '1' FAN_SPEEDS = [FAN_SPEED_NORMAL, FAN_SPEED_MAX] PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Required(CONF_IP_ADDRESS): cv.string, vol.Required(CONF_USERNAME): cv.string, vol.Required(CONF_PASSWORD): cv.string, }, extra=vol.ALLOW_EXTRA) # Commonly supported features SUPPORT_ROBOVAC = SUPPORT_BATTERY | SUPPORT_RETURN_HOME | SUPPORT_TURN_ON | \ SUPPORT_STATUS | SUPPORT_STOP | SUPPORT_TURN_OFF | \ SUPPORT_CLEAN_SPOT | SUPPORT_START | SUPPORT_LOCATE async def async_setup_platform( hass, config, async_add_entities, discovery_info=None): """Set up the Eufy RoboVac vacuum cleaner platform.""" from robovac import Robovac, get_local_code if PLATFORM not in hass.data: hass.data[PLATFORM] = {}
from requests.exceptions import ConnectionError REQUIREMENTS = ['robart==0.1.1'] _LOGGER = logging.getLogger(__name__) ATTR_POSITION = 'position' ATTR_CHARGING = 'charging' ATTR_UNIQUE_ID = 'unique_id' ATTR_SOFTWARE_VERSION = 'software_version' PLATFORM = 'robart' PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Required(CONF_HOST): cv.string, }, extra=vol.ALLOW_EXTRA) # Commonly supported features SUPPORT_ROBART = SUPPORT_BATTERY | SUPPORT_PAUSE | SUPPORT_RETURN_HOME | \ SUPPORT_SEND_COMMAND | SUPPORT_STATUS | SUPPORT_STOP | \ SUPPORT_TURN_OFF | SUPPORT_TURN_ON STATE_CLEANING = "cleaning" STATE_GOHOME = "go_home" STATE_NOTREADY = "not_ready" async def async_setup_platform( hass, config, async_add_entities, discovery_info=None):
SUPPORT_TURN_OFF, SUPPORT_TURN_ON, VACUUM_SERVICE_SCHEMA, VacuumDevice) from homeassistant.const import ( ATTR_ENTITY_ID, CONF_HOST, CONF_NAME, CONF_TOKEN, STATE_OFF, STATE_ON) import homeassistant.helpers.config_validation as cv REQUIREMENTS = ['python-miio==0.3.7'] _LOGGER = logging.getLogger(__name__) DEFAULT_NAME = 'Xiaomi Vacuum cleaner' ICON = 'mdi:roomba' PLATFORM = 'xiaomi_miio' PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Required(CONF_HOST): cv.string, vol.Required(CONF_TOKEN): vol.All(str, vol.Length(min=32, max=32)), vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, }, extra=vol.ALLOW_EXTRA) SERVICE_MOVE_REMOTE_CONTROL = 'xiaomi_remote_control_move' SERVICE_MOVE_REMOTE_CONTROL_STEP = 'xiaomi_remote_control_move_step' SERVICE_START_REMOTE_CONTROL = 'xiaomi_remote_control_start' SERVICE_STOP_REMOTE_CONTROL = 'xiaomi_remote_control_stop' FAN_SPEEDS = { 'Quiet': 38, 'Balanced': 60, 'Turbo': 77, 'Max': 90} ATTR_CLEANING_TIME = 'cleaning_time'
SUPPORT_DEEBOT = (SUPPORT_BATTERY | SUPPORT_FAN_SPEED | SUPPORT_LOCATE | SUPPORT_PAUSE | SUPPORT_RETURN_HOME | SUPPORT_SEND_COMMAND | SUPPORT_START | SUPPORT_STATE) PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { vol.Required(CONF_USERNAME): cv.string, vol.Required(CONF_PASSWORD): cv.string, vol.Required(CONF_COUNTRY): vol.All(vol.Lower, cv.string), vol.Required(CONF_CONTINENT): vol.All(vol.Lower, cv.string), vol.Required(CONF_DEVICEID): cv.string, vol.Required(CONF_LIVEMAPPATH): cv.string, }, extra=vol.ALLOW_EXTRA, ) STATE_CODE_TO_STATE = { 'STATE_IDLE': STATE_IDLE, 'STATE_CLEANING': STATE_CLEANING, 'STATE_RETURNING': STATE_RETURNING, 'STATE_DOCKED': STATE_DOCKED, 'STATE_ERROR': STATE_ERROR, 'STATE_PAUSED': STATE_PAUSED, }
CONF_DEVICE_ID = 'deviceId' CONF_TOKEN = 'token' CONF_USER_ID = 'userId' CONF_SLEEP = 'sleep_duration_on_exit' CONF_AUTH_CODE = 'authCode' CONF_MAP_PATH = 'map_path' PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Required(CONF_HOST): cv.string, vol.Required(CONF_DEVICE_ID): cv.string, vol.Required(CONF_TOKEN): cv.string, vol.Required(CONF_USER_ID): cv.string, vol.Required(CONF_AUTH_CODE): cv.string, vol.Optional(CONF_SLEEP, default=60): int, vol.Optional(CONF_MAP_PATH, default='/tmp/proscenic_vacuum_map.svg'): cv.string, vol.Optional(CONF_NAME): cv.string }) WORK_STATE_TO_STATE = { WorkState.RETURN_TO_BASE: STATE_RETURNING, WorkState.CLEANING: STATE_CLEANING, WorkState.PENDING: STATE_IDLE, WorkState.UNKNONW3: STATE_ERROR, WorkState.ERROR: STATE_ERROR,
DEFAULT_CERT = '/etc/ssl/certs/ca-certificates.crt' DEFAULT_CONTINUOUS = True DEFAULT_NAME = 'Roomba' ICON = 'mdi:roomba' PLATFORM = 'roomba' FAN_SPEED_AUTOMATIC = 'Automatic' FAN_SPEED_ECO = 'Eco' FAN_SPEED_PERFORMANCE = 'Performance' FAN_SPEEDS = [FAN_SPEED_AUTOMATIC, FAN_SPEED_ECO, FAN_SPEED_PERFORMANCE] PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Required(CONF_HOST): cv.string, vol.Required(CONF_USERNAME): cv.string, vol.Required(CONF_PASSWORD): cv.string, vol.Optional(CONF_CERT, default=DEFAULT_CERT): cv.string, vol.Optional(CONF_CONTINUOUS, default=DEFAULT_CONTINUOUS): cv.boolean, }, extra=vol.ALLOW_EXTRA) # Commonly supported features SUPPORT_ROOMBA = SUPPORT_BATTERY | SUPPORT_PAUSE | SUPPORT_RETURN_HOME | \ SUPPORT_SEND_COMMAND | SUPPORT_STATUS | SUPPORT_STOP | \ SUPPORT_TURN_OFF | SUPPORT_TURN_ON # Only Roombas with CarpetBost can set their fanspeed SUPPORT_ROOMBA_CARPET_BOOST = SUPPORT_ROOMBA | SUPPORT_FAN_SPEED @asyncio.coroutine def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
SUPPORT_DEEBOT = (SUPPORT_BATTERY | SUPPORT_FAN_SPEED | SUPPORT_LOCATE | SUPPORT_PAUSE | SUPPORT_RETURN_HOME | SUPPORT_SEND_COMMAND | SUPPORT_START | SUPPORT_STATE) PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { vol.Required(CONF_USERNAME): cv.string, vol.Required(CONF_PASSWORD): cv.string, vol.Required(CONF_COUNTRY): vol.All(vol.Lower, cv.string), vol.Required(CONF_CONTINENT): vol.All(vol.Lower, cv.string), vol.Required(CONF_DEVICEID): cv.string, vol.Optional(CONF_LIVEMAP, default=True): cv.boolean, vol.Optional(CONF_SHOWCOLORROOMS, default=False): cv.boolean, vol.Optional(CONF_LIVEMAPPATH, default='www/live_map.png'): cv.string }, extra=vol.ALLOW_EXTRA, ) STATE_CODE_TO_STATE = { 'STATE_IDLE': STATE_IDLE, 'STATE_CLEANING': STATE_CLEANING, 'STATE_RETURNING': STATE_RETURNING, 'STATE_DOCKED': STATE_DOCKED, 'STATE_ERROR': STATE_ERROR, 'STATE_PAUSED': STATE_PAUSED, }
ATTR_TURBO = 'JSON_TURBO' DEFAULT_NAME = 'Hombot' ICON = 'mdi:robot-vacuum' #ICON = 'mdi:roomba' PLATFORM = 'lg_hombot' FAN_SPEED_NORMAL = 'Normal' FAN_SPEED_TURBO = 'Turbo' FAN_SPEEDS = [FAN_SPEED_NORMAL, FAN_SPEED_TURBO] PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Required(CONF_HOST): cv.string, vol.Required(CONF_PORT): cv.string, }, extra=vol.ALLOW_EXTRA) # Commonly supported features SUPPORT_HOMBOT = SUPPORT_BATTERY | SUPPORT_PAUSE | SUPPORT_RETURN_HOME | \ SUPPORT_SEND_COMMAND | SUPPORT_STATUS | SUPPORT_STOP | \ SUPPORT_TURN_OFF | SUPPORT_TURN_ON | SUPPORT_FAN_SPEED @asyncio.coroutine def async_setup_platform(hass, config, async_add_devices, discovery_info=None): """Set up the LG Hombot vacuum cleaner platform.""" if PLATFORM not in hass.data: hass.data[PLATFORM] = {}
SUPPORT_PROSCENIC = ( SUPPORT_RETURN_HOME | SUPPORT_STOP | SUPPORT_TURN_OFF | SUPPORT_TURN_ON | SUPPORT_STATUS | SUPPORT_BATTERY # | SUPPORT_LOCATE ) PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Required(CONF_HOST): cv.string, vol.Required(CONF_DEVICE_ID): cv.string, vol.Required(CONF_TOKEN): cv.string, vol.Required(CONF_USER_ID): cv.string, vol.Required(CONF_AUTH_CODE): cv.string, vol.Optional(CONF_SLEEP, default = DEFAULT_CONF_SLEEP): int, vol.Optional(CONF_MAP_PATH, default = DEFAULT_CONF_MAP_PATH): cv.string, vol.Optional(CONF_NAME): cv.string }) WORK_STATE_TO_STATE = { WorkState.RETURN_TO_BASE: STATE_RETURNING, WorkState.CLEANING: STATE_CLEANING, WorkState.PENDING: STATE_IDLE, WorkState.UNKNONW3: STATE_ERROR, WorkState.ERROR: STATE_ERROR, WorkState.NEAR_BASE: STATE_DOCKED, WorkState.POWER_OFF: 'off', WorkState.OTHER_POWER_OFF: 'off', WorkState.CHARGING: STATE_DOCKED,
SUPPORT_RETURN_HOME, SUPPORT_START, SUPPORT_STATE, SUPPORT_STOP, StateVacuumEntity, SUPPORT_PAUSE, STATE_RETURNING, ATTR_CLEANED_AREA) from homeassistant.const import (CONF_HOST, CONF_NAME, CONF_DEVICE_ID) from pytuya import Device from .const import (CONF_LOCAL_KEY, DEFAULT_NAME, CONF_REMEMBER_FAN_SPEED, ATTR_ERROR, ATTR_CLEANING_TIME, ATTR_MOP_EQUIPPED, REMEMBER_FAN_SPEED_DELAY, DATA_KEY, STATE_MOPPING, STATES) _LOGGER = logging.getLogger(__name__) PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { vol.Required(CONF_HOST): cv.string, vol.Required(CONF_DEVICE_ID): cv.string, vol.Required(CONF_LOCAL_KEY): vol.All(str, vol.Length(min=15, max=16)), vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Optional(CONF_REMEMBER_FAN_SPEED, default=False): cv.boolean }, extra=vol.ALLOW_EXTRA, ) SUPPORT_PROSENIC = (SUPPORT_STATE | SUPPORT_STOP | SUPPORT_RETURN_HOME | SUPPORT_FAN_SPEED | SUPPORT_BATTERY | SUPPORT_CLEAN_SPOT | SUPPORT_START | SUPPORT_PAUSE)
ATTR_MODEL, ATTR_FIRMWARE_VERSION, ATTR_HARDWARE_VERSION, SCHEMA, MAP, DUMMY_IP, DUMMY_TOKEN, ) TYPE = 'vacuum' _LOGGER = logging.getLogger(__name__) DEFAULT_NAME = "Generic MIoT " + TYPE DATA_KEY = TYPE + '.' + DOMAIN PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(SCHEMA) STATE_MAPPING = { STATE_CLEANING: ['Sweeping'], STATE_DOCKED: ['Charging'], STATE_IDLE: ['Idle'], STATE_PAUSED: ['Paused'], STATE_RETURNING: ['Go Charging'], } SCAN_INTERVAL = timedelta(seconds=10) # pylint: disable=unused-argument @asyncio.coroutine async def async_setup_platform(hass,