Add an asyncio Lock around pairing, which cant be used concurrently (#21933)

This commit is contained in:
Jc2k authored and Paulus Schoutsen committed 2019-03-11 11:59:41 -07:00
1 parent 4f5446ff02
commit 5e2302e469
7 files changed
+76 -63

No files matched your search

@@ -80,21 +80,21 @@ class HomeKitClimateDevice(HomeKitEntity, ClimateDevice):
def _update_temperature_target(self, value):
self._target_temp = value
def set_temperature(self, **kwargs):
async def async_set_temperature(self, **kwargs):
"""Set new target temperature."""
temp = kwargs.get(ATTR_TEMPERATURE)
characteristics = [{'aid': self._aid,
'iid': self._chars['temperature.target'],
'value': temp}]
self.put_characteristics(characteristics)
await self._accessory.put_characteristics(characteristics)
def set_operation_mode(self, operation_mode):
async def async_set_operation_mode(self, operation_mode):
"""Set new target operation mode."""
characteristics = [{'aid': self._aid,
'iid': self._chars['heating-cooling.target'],
'value': MODE_HASS_TO_HOMEKIT[operation_mode]}]
self.put_characteristics(characteristics)
await self._accessory.put_characteristics(characteristics)
@property
def state(self):