diff --git a/.coveragerc b/.coveragerc index 1107f22e5ef..74fb5c11cec 100644 --- a/.coveragerc +++ b/.coveragerc @@ -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/* diff --git a/homeassistant/components/fan/services.yaml b/homeassistant/components/fan/services.yaml index 0e3978690e6..3cb3db6dfe0 100644 --- a/homeassistant/components/fan/services.yaml +++ b/homeassistant/components/fan/services.yaml @@ -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' diff --git a/homeassistant/components/wemo/__init__.py b/homeassistant/components/wemo/__init__.py index df2d8ed1f31..fe63f10aeba 100644 --- a/homeassistant/components/wemo/__init__.py +++ b/homeassistant/components/wemo/__init__.py @@ -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 = { diff --git a/homeassistant/components/wemo/const.py b/homeassistant/components/wemo/const.py new file mode 100644 index 00000000000..e9272d39bdd --- /dev/null +++ b/homeassistant/components/wemo/const.py @@ -0,0 +1,5 @@ +"""Constants for the Belkin Wemo component.""" +DOMAIN = "wemo" + +SERVICE_SET_HUMIDITY = "set_humidity" +SERVICE_RESET_FILTER_LIFE = "reset_filter_life" diff --git a/homeassistant/components/wemo/fan.py b/homeassistant/components/wemo/fan.py index 91273fa033f..4a8be4fba81 100644 --- a/homeassistant/components/wemo/fan.py +++ b/homeassistant/components/wemo/fan.py @@ -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}) diff --git a/homeassistant/components/wemo/services.yaml b/homeassistant/components/wemo/services.yaml index e69de29bb2d..c2415265c62 100644 --- a/homeassistant/components/wemo/services.yaml +++ b/homeassistant/components/wemo/services.yaml @@ -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' diff --git a/homeassistant/components/wemo/switch.py b/homeassistant/components/wemo/switch.py index c1d07a06902..1c0606b489d 100644 --- a/homeassistant/components/wemo/switch.py +++ b/homeassistant/components/wemo/switch.py @@ -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):