move wemo services to wemo domain (#29135)

This commit is contained in:
Raman Gupta 2019-11-27 19:49:12 -05:00 committed by Paulus Schoutsen
parent 9fd058aa33
commit 88376bf363
7 changed files with 26 additions and 27 deletions

View File

@ -770,7 +770,6 @@ omit =
homeassistant/components/waze_travel_time/sensor.py
homeassistant/components/webostv/*
homeassistant/components/wemo/*
homeassistant/components/wemo/fan.py
homeassistant/components/whois/sensor.py
homeassistant/components/wink/*
homeassistant/components/wirelesstag/*

View File

@ -194,20 +194,3 @@ xiaomi_miio_set_dry_off:
entity_id:
description: Name of the xiaomi miio entity.
example: 'fan.xiaomi_miio_device'
wemo_set_humidity:
description: Set the target humidity of WeMo humidifier devices.
fields:
entity_id:
description: Names of the WeMo humidifier entities (1 or more entity_ids are required).
example: 'fan.wemo_humidifier'
target_humidity:
description: Target humidity. This is a float value between 0 and 100, but will be mapped to the humidity levels that WeMo humidifiers support (45, 50, 55, 60, and 100/Max) by rounding the value down to the nearest supported value.
example: 56.5
wemo_reset_filter_life:
description: Reset the WeMo Humidifier's filter life to 100%.
fields:
entity_id:
description: Names of the WeMo humidifier entities (1 or more entity_ids are required).
example: 'fan.wemo_humidifier'

View File

@ -11,8 +11,7 @@ from homeassistant.helpers import config_validation as cv
from homeassistant.helpers import discovery
from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP
DOMAIN = "wemo"
from .const import DOMAIN
# Mapping from Wemo model_name to component.
WEMO_MODEL_DISPATCH = {

View File

@ -0,0 +1,5 @@
"""Constants for the Belkin Wemo component."""
DOMAIN = "wemo"
SERVICE_SET_HUMIDITY = "set_humidity"
SERVICE_RESET_FILTER_LIFE = "reset_filter_life"

View File

@ -10,7 +10,6 @@ import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.fan import (
DOMAIN,
SUPPORT_SET_SPEED,
FanEntity,
SPEED_OFF,
@ -22,6 +21,7 @@ from homeassistant.exceptions import PlatformNotReady
from homeassistant.const import ATTR_ENTITY_ID
from . import SUBSCRIPTION_REGISTRY
from .const import DOMAIN, SERVICE_RESET_FILTER_LIFE, SERVICE_SET_HUMIDITY
SCAN_INTERVAL = timedelta(seconds=10)
DATA_KEY = "fan.wemo"
@ -79,8 +79,6 @@ HASS_FAN_SPEED_TO_WEMO = {
if k not in [WEMO_FAN_LOW, WEMO_FAN_HIGH]
}
SERVICE_SET_HUMIDITY = "wemo_set_humidity"
SET_HUMIDITY_SCHEMA = vol.Schema(
{
vol.Required(ATTR_ENTITY_ID): cv.entity_ids,
@ -90,8 +88,6 @@ SET_HUMIDITY_SCHEMA = vol.Schema(
}
)
SERVICE_RESET_FILTER_LIFE = "wemo_reset_filter_life"
RESET_FILTER_LIFE_SCHEMA = vol.Schema({vol.Required(ATTR_ENTITY_ID): cv.entity_ids})

View File

@ -0,0 +1,16 @@
set_humidity:
description: Set the target humidity of WeMo humidifier devices.
fields:
entity_id:
description: Names of the WeMo humidifier entities (1 or more entity_ids are required).
example: 'fan.wemo_humidifier'
target_humidity:
description: Target humidity. This is a float value between 0 and 100, but will be mapped to the humidity levels that WeMo humidifiers support (45, 50, 55, 60, and 100/Max) by rounding the value down to the nearest supported value.
example: 56.5
reset_filter_life:
description: Reset the WeMo Humidifier's filter life to 100%.
fields:
entity_id:
description: Names of the WeMo humidifier entities (1 or more entity_ids are required).
example: 'fan.wemo_humidifier'

View File

@ -12,7 +12,8 @@ from homeassistant.exceptions import PlatformNotReady
from homeassistant.util import convert
from homeassistant.const import STATE_OFF, STATE_ON, STATE_STANDBY, STATE_UNKNOWN
from . import SUBSCRIPTION_REGISTRY, DOMAIN as WEMO_DOMAIN
from . import SUBSCRIPTION_REGISTRY
from .const import DOMAIN
SCAN_INTERVAL = timedelta(seconds=10)
@ -96,7 +97,7 @@ class WemoSwitch(SwitchDevice):
@property
def device_info(self):
"""Return the device info."""
return {"name": self._name, "identifiers": {(WEMO_DOMAIN, self._serialnumber)}}
return {"name": self._name, "identifiers": {(DOMAIN, self._serialnumber)}}
@property
def device_state_attributes(self):