Adapt Axis integration to async HTTPx calls (#42095)

This commit is contained in:
Robert Svensson authored and GitHub committed 2020-10-20 09:31:04 +02:00
1 parent fcdb54d878
commit 1303d20064
9 files changed
+41 -40

No files matched your search

+2 -6
View File
@@ -37,15 +37,11 @@ class AxisSwitch(AxisEventBase, SwitchEntity):
async def async_turn_on(self, **kwargs):
"""Turn on switch."""
await self.hass.async_add_executor_job(
self.device.api.vapix.ports[self.event.id].close
)
await self.device.api.vapix.ports[self.event.id].close()
async def async_turn_off(self, **kwargs):
"""Turn off switch."""
await self.hass.async_add_executor_job(
self.device.api.vapix.ports[self.event.id].open
)
await self.device.api.vapix.ports[self.event.id].open()
@property
def name(self):