From 70d95106f23abfde8539850d03cbe3f08de02560 Mon Sep 17 00:00:00 2001 From: Eric Severance Date: Sun, 19 Dec 2021 19:55:20 -0800 Subject: [PATCH 1/2] Bump pywemo==0.7.0 --- homeassistant/components/wemo/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/wemo/manifest.json b/homeassistant/components/wemo/manifest.json index 59eae24c714f4..d0643ed51a98b 100644 --- a/homeassistant/components/wemo/manifest.json +++ b/homeassistant/components/wemo/manifest.json @@ -3,7 +3,7 @@ "name": "Belkin WeMo", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/wemo", - "requirements": ["pywemo==0.6.7"], + "requirements": ["pywemo==0.7.0"], "ssdp": [ { "manufacturer": "Belkin International Inc." diff --git a/requirements_all.txt b/requirements_all.txt index 3cde5400641d9..1cd54e506e80a 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2019,7 +2019,7 @@ pyvolumio==0.1.3 pywebpush==1.9.2 # homeassistant.components.wemo -pywemo==0.6.7 +pywemo==0.7.0 # homeassistant.components.wilight pywilight==0.0.70 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index cfb9f5f8c7645..9cf5db148ba94 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1218,7 +1218,7 @@ pyvolumio==0.1.3 pywebpush==1.9.2 # homeassistant.components.wemo -pywemo==0.6.7 +pywemo==0.7.0 # homeassistant.components.wilight pywilight==0.0.70 From 019ecc198fc54052da5167c5ca54654f358f8b97 Mon Sep 17 00:00:00 2001 From: Eric Severance Date: Sun, 19 Dec 2021 20:24:13 -0800 Subject: [PATCH 2/2] Update tests to use new pyWeMo long-press supported classes --- tests/components/wemo/conftest.py | 2 +- tests/components/wemo/test_device_trigger.py | 10 +++++----- tests/components/wemo/test_wemo_device.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/components/wemo/conftest.py b/tests/components/wemo/conftest.py index 08abd140dac74..13ec0cb2337dc 100644 --- a/tests/components/wemo/conftest.py +++ b/tests/components/wemo/conftest.py @@ -57,7 +57,7 @@ def pywemo_device_fixture(pywemo_registry, pywemo_model): device.port = MOCK_PORT device.name = MOCK_NAME device.serialnumber = MOCK_SERIAL_NUMBER - device.model_name = pywemo_model + device.model_name = pywemo_model.replace("LongPress", "") device.get_state.return_value = 0 # Default to Off device.supports_long_press.return_value = cls.supports_long_press() diff --git a/tests/components/wemo/test_device_trigger.py b/tests/components/wemo/test_device_trigger.py index 76016469b727e..0ad7d95dd7aaa 100644 --- a/tests/components/wemo/test_device_trigger.py +++ b/tests/components/wemo/test_device_trigger.py @@ -3,7 +3,6 @@ from pywemo.subscribe import EVENT_TYPE_LONG_PRESS from homeassistant.components.automation import DOMAIN as AUTOMATION_DOMAIN -from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN from homeassistant.components.wemo.const import DOMAIN, WEMO_SUBSCRIPTION_EVENT from homeassistant.const import ( CONF_DEVICE_ID, @@ -11,6 +10,7 @@ CONF_ENTITY_ID, CONF_PLATFORM, CONF_TYPE, + Platform, ) from homeassistant.setup import async_setup_component @@ -26,8 +26,8 @@ @pytest.fixture def pywemo_model(): - """Pywemo Dimmer models use the light platform (WemoDimmer class).""" - return "Dimmer" + """Pywemo LightSwitch models use the switch platform.""" + return "LightSwitchLongPress" async def setup_automation(hass, device_id, trigger_type): @@ -67,14 +67,14 @@ async def test_get_triggers(hass, wemo_entity): }, { CONF_DEVICE_ID: wemo_entity.device_id, - CONF_DOMAIN: LIGHT_DOMAIN, + CONF_DOMAIN: Platform.SWITCH, CONF_ENTITY_ID: wemo_entity.entity_id, CONF_PLATFORM: "device", CONF_TYPE: "turned_off", }, { CONF_DEVICE_ID: wemo_entity.device_id, - CONF_DOMAIN: LIGHT_DOMAIN, + CONF_DOMAIN: Platform.SWITCH, CONF_ENTITY_ID: wemo_entity.entity_id, CONF_PLATFORM: "device", CONF_TYPE: "turned_on", diff --git a/tests/components/wemo/test_wemo_device.py b/tests/components/wemo/test_wemo_device.py index e756e816a4727..9ef9e6b56857f 100644 --- a/tests/components/wemo/test_wemo_device.py +++ b/tests/components/wemo/test_wemo_device.py @@ -26,8 +26,8 @@ @pytest.fixture def pywemo_model(): - """Pywemo Dimmer models use the light platform (WemoDimmer class).""" - return "Dimmer" + """Pywemo LightSwitch models use the switch platform.""" + return "LightSwitchLongPress" async def test_async_register_device_longpress_fails(hass, pywemo_device):