diff --git a/CODEOWNERS b/CODEOWNERS index bcbd6c20364..3ad4c23816c 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1046,7 +1046,7 @@ build.json @home-assistant/supervisor /tests/components/switchbot/ @bdraco @danielhiversen @RenierM26 @murtas /homeassistant/components/switcher_kis/ @tomerfi @thecode /tests/components/switcher_kis/ @tomerfi @thecode -/homeassistant/components/switchmate/ @danielhiversen +/homeassistant/components/switchmate/ @danielhiversen @qiz-li /homeassistant/components/syncthing/ @zhulik /tests/components/syncthing/ @zhulik /homeassistant/components/syncthru/ @nielstron diff --git a/homeassistant/components/switchmate/manifest.json b/homeassistant/components/switchmate/manifest.json index c4a263aca19..930fb6bf88e 100644 --- a/homeassistant/components/switchmate/manifest.json +++ b/homeassistant/components/switchmate/manifest.json @@ -2,8 +2,8 @@ "domain": "switchmate", "name": "Switchmate SimplySmart Home", "documentation": "https://www.home-assistant.io/integrations/switchmate", - "requirements": ["pySwitchmate==0.4.6"], - "codeowners": ["@danielhiversen"], + "requirements": ["pySwitchmate==0.5.1"], + "codeowners": ["@danielhiversen", "@qiz-li"], "iot_class": "local_polling", "loggers": ["switchmate"] } diff --git a/homeassistant/components/switchmate/switch.py b/homeassistant/components/switchmate/switch.py index b0f2b58a1fa..7beb89f8de1 100644 --- a/homeassistant/components/switchmate/switch.py +++ b/homeassistant/components/switchmate/switch.py @@ -4,7 +4,7 @@ from __future__ import annotations from datetime import timedelta # pylint: disable=import-error -import switchmate +from switchmate import Switchmate import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity @@ -49,7 +49,7 @@ class SwitchmateEntity(SwitchEntity): self._mac = mac self._name = name - self._device = switchmate.Switchmate(mac=mac, flip_on_off=flip_on_off) + self._device = Switchmate(mac=mac, flip_on_off=flip_on_off) @property def unique_id(self) -> str: @@ -66,19 +66,19 @@ class SwitchmateEntity(SwitchEntity): """Return the name of the switch.""" return self._name - def update(self) -> None: + async def async_update(self) -> None: """Synchronize state with switch.""" - self._device.update() + await self._device.update() @property def is_on(self) -> bool: """Return true if it is on.""" return self._device.state - def turn_on(self, **kwargs) -> None: + async def async_turn_on(self, **kwargs) -> None: """Turn the switch on.""" - self._device.turn_on() + await self._device.turn_on() - def turn_off(self, **kwargs) -> None: + async def async_turn_off(self, **kwargs) -> None: """Turn the switch off.""" - self._device.turn_off() + await self._device.turn_off() diff --git a/requirements_all.txt b/requirements_all.txt index 526f5f29c71..6aaa99d7838 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1357,7 +1357,7 @@ pyMetno==0.9.0 pyRFXtrx==0.30.0 # homeassistant.components.switchmate -# pySwitchmate==0.4.6 +pySwitchmate==0.5.1 # homeassistant.components.tibber pyTibber==0.22.3 diff --git a/script/gen_requirements_all.py b/script/gen_requirements_all.py index dcc53a73df0..5ef794b4eab 100755 --- a/script/gen_requirements_all.py +++ b/script/gen_requirements_all.py @@ -30,7 +30,6 @@ COMMENT_REQUIREMENTS = ( "opencv-python-headless", "pybluez", "pycups", - "pySwitchmate", "python-eq3bt", "python-gammu", "python-lirc",