Skip to content

Commit 5fe08a7

Browse files
gieljnssnsHugo Dupras
authored andcommitted
fix for outdoor_motion keyError
1 parent 98ffa3e commit 5fe08a7

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

smart_home/Camera.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,11 @@ def outdoormotionDetected(self, home=None, camera=None, offset=0):
391391
except TypeError:
392392
print("outdoormotionDetected: Camera name or home is unknown")
393393
return False
394-
if self.lastEvent[cam_id]['type'] == 'movement':
395-
if self.lastEvent[cam_id]['video_status'] == 'recording' and\
396-
self.lastEvent[cam_id]['time'] + offset > int(time.time()):
397-
return True
394+
if cam_id in self.lastEvent:
395+
if self.lastEvent[cam_id]['type'] == 'movement':
396+
if self.lastEvent[cam_id]['video_status'] == 'recording' and\
397+
self.lastEvent[cam_id]['time'] + offset > int(time.time()):
398+
return True
398399
return False
399400

400401
def humanDetected(self, home=None, camera=None, offset=0):

0 commit comments

Comments
 (0)