Beispiel #1
0
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_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'
Beispiel #3
0
    SERVICE_CLEAN_ZONE,
    SERVICE_MOVE_REMOTE_CONTROL,
    SERVICE_MOVE_REMOTE_CONTROL_STEP,
    SERVICE_START_REMOTE_CONTROL,
    SERVICE_STOP_REMOTE_CONTROL,
)

_LOGGER = logging.getLogger(__name__)

DEFAULT_NAME = "Xiaomi Vacuum cleaner"
DATA_KEY = "vacuum.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,
)

FAN_SPEEDS = {
    "Quiet": 38,
    "Balanced": 60,
    "Turbo": 77,
    "Max": 90,
    "Gentle": 105
}

ATTR_CLEAN_START = "clean_start"
ATTR_CLEAN_STOP = "clean_stop"
ATTR_CLEANING_TIME = "cleaning_time"
import homeassistant.helpers.config_validation as cv
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,
Beispiel #5
0
from .const import (CONF_LOCAL_KEY, DEFAULT_NAME, CONF_REMEMBER_FAN_SPEED,
                    CONF_ENABLE_DEBUG, ATTR_ERROR, ATTR_CLEANING_TIME,
                    ATTR_MOP_EQUIPPED, ATTR_SENSOR_HEALTH, ATTR_FILTER_HEALTH,
                    ATTR_SIDE_BRUSH_HEALTH, ATTR_BRUSH_HEALTH,
                    ATTR_RESET_FILTER, ATTR_DEVICE_MODEL, ATTR_WATER_SPEED,
                    ATTR_WATER_SPEED_LIST, REMEMBER_FAN_SPEED_DELAY, DATA_KEY,
                    STATE_MOPPING, STATES, SERVICE_SET_WATER_SPEED)

_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,
        vol.Optional(CONF_ENABLE_DEBUG, 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)
    | SUPPORT_BATTERY
    # | SUPPORT_LOCATE
)

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,
    WorkState.NEAR_BASE: STATE_DOCKED,
    WorkState.POWER_OFF: 'off',
    WorkState.OTHER_POWER_OFF: 'off',
    WorkState.CHARGING: STATE_DOCKED,
Beispiel #7
0
DEFAULT_DELAY = 1
DEFAULT_NAME = "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,
        vol.Optional(CONF_DELAY, default=DEFAULT_DELAY): cv.positive_int,
    },
    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