From c61a652c9085efc0717682de432488fe0975c982 Mon Sep 17 00:00:00 2001 From: Sriram Vaidyanathan Date: Fri, 29 Jun 2018 19:53:14 +0530 Subject: [PATCH] Fixed Indentation error (#15210) * Fixed Indentation error * Update xiaomi.py --- homeassistant/components/camera/xiaomi.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/camera/xiaomi.py b/homeassistant/components/camera/xiaomi.py index f0e66dbd20e..e80f4b7532a 100644 --- a/homeassistant/components/camera/xiaomi.py +++ b/homeassistant/components/camera/xiaomi.py @@ -113,14 +113,16 @@ class XiaomiCamera(Camera): except error_perm as exc: _LOGGER.error('Unable to find path: %s - %s', first_dir, exc) return False + if self._model == MODEL_XIAOFANG: dirs = [d for d in ftp.nlst() if '.' not in d] if not dirs: _LOGGER.warning("There don't appear to be any uploaded videos") return False - latest_dir = dirs[-1] - ftp.cwd(latest_dir) + latest_dir = dirs[-1] + ftp.cwd(latest_dir) + videos = [v for v in ftp.nlst() if '.tmp' not in v] if not videos: _LOGGER.info('Video folder "%s" is empty; delaying', latest_dir)