mirror of https://github.com/home-assistant/core
Bump Switchmate dependency to 0.5.1 (#75163)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
2b617e3885
commit
1f73a553c8
|
@ -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
|
||||
|
|
|
@ -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"]
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -30,7 +30,6 @@ COMMENT_REQUIREMENTS = (
|
|||
"opencv-python-headless",
|
||||
"pybluez",
|
||||
"pycups",
|
||||
"pySwitchmate",
|
||||
"python-eq3bt",
|
||||
"python-gammu",
|
||||
"python-lirc",
|
||||
|
|
Loading…
Reference in New Issue