Simplfy homekit_controller characteristic writes (#32683)
This commit is contained in:
parent
c56530a712
commit
ffe8b94d75
10 changed files with 123 additions and 233 deletions
|
@ -43,13 +43,11 @@ class HomeKitSwitch(HomeKitEntity, SwitchDevice):
|
|||
|
||||
async def async_turn_on(self, **kwargs):
|
||||
"""Turn the specified switch on."""
|
||||
characteristics = [{"aid": self._aid, "iid": self._chars["on"], "value": True}]
|
||||
await self._accessory.put_characteristics(characteristics)
|
||||
await self.async_put_characteristics({CharacteristicsTypes.ON: True})
|
||||
|
||||
async def async_turn_off(self, **kwargs):
|
||||
"""Turn the specified switch off."""
|
||||
characteristics = [{"aid": self._aid, "iid": self._chars["on"], "value": False}]
|
||||
await self._accessory.put_characteristics(characteristics)
|
||||
await self.async_put_characteristics({CharacteristicsTypes.ON: False})
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue