From 239e314dc15016c7fbfa9b273391e39b2dc353d0 Mon Sep 17 00:00:00 2001 From: Adam Belebczuk Date: Wed, 31 Oct 2018 05:54:15 -0400 Subject: [PATCH] Add services.yaml entry for new WeMo Humidifier platform service (#18032) * WeMo Humidifier - Add entry to services.yaml * WeMo Humidifier - Fix typo in wemo.py * WeMo Humidifier - Fixed incorrect parameter name --- homeassistant/components/fan/services.yaml | 10 ++++++++++ homeassistant/components/fan/wemo.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/fan/services.yaml b/homeassistant/components/fan/services.yaml index 039cc33f748..b183c6049ee 100644 --- a/homeassistant/components/fan/services.yaml +++ b/homeassistant/components/fan/services.yaml @@ -204,3 +204,13 @@ 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 (0 or more entities, if no entity_id is provided, all WeMo humidifiers will have the target humidity set). + 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 diff --git a/homeassistant/components/fan/wemo.py b/homeassistant/components/fan/wemo.py index 902868e4f43..0c570465f4d 100644 --- a/homeassistant/components/fan/wemo.py +++ b/homeassistant/components/fan/wemo.py @@ -251,7 +251,7 @@ class WemoHumidifier(FanEntity): async def _async_locked_update(self, force_update): """Try updating within an async lock.""" async with self._update_lock: - await self.hass.asyn_add_executor_job(self._update, force_update) + await self.hass.async_add_executor_job(self._update, force_update) def _update(self, force_update=True): """Update the device state."""