Fix Arlo doing I/O in event loop (#32190)

This commit is contained in:
Paulus Schoutsen 2020-02-25 14:10:43 -08:00 committed by GitHub
parent 1f23361a5d
commit fc0278c91f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -110,19 +110,19 @@ class ArloBaseStation(AlarmControlPanel):
else:
self._state = None
async def async_alarm_disarm(self, code=None):
def alarm_disarm(self, code=None):
"""Send disarm command."""
self._base_station.mode = DISARMED
async def async_alarm_arm_away(self, code=None):
def alarm_arm_away(self, code=None):
"""Send arm away command. Uses custom mode."""
self._base_station.mode = self._away_mode_name
async def async_alarm_arm_home(self, code=None):
def alarm_arm_home(self, code=None):
"""Send arm home command. Uses custom mode."""
self._base_station.mode = self._home_mode_name
async def async_alarm_arm_night(self, code=None):
def alarm_arm_night(self, code=None):
"""Send arm night command. Uses custom mode."""
self._base_station.mode = self._night_mode_name

View File

@ -78,8 +78,10 @@ class ArloCam(Camera):
async def handle_async_mjpeg_stream(self, request):
"""Generate an HTTP MJPEG stream from the camera."""
video = await self.hass.async_add_executor_job(
getattr, self._camera, "last_video"
)
video = self._camera.last_video
if not video:
error_msg = (
f"Video not found for {self.name}. "