From c8458fd7c5364d71e849c505ee27f7cc335cbed8 Mon Sep 17 00:00:00 2001 From: Sriram Vaidyanathan Date: Mon, 25 Jun 2018 22:44:36 +0530 Subject: [PATCH] Update xiaomi.py (#15136) * Update xiaomi.py Minor logic fix for Xiaofang cameras. * Removed whitespace * Removed whitespace --- homeassistant/components/camera/xiaomi.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/homeassistant/components/camera/xiaomi.py b/homeassistant/components/camera/xiaomi.py index c18a3649e7b..f0e66dbd20e 100644 --- a/homeassistant/components/camera/xiaomi.py +++ b/homeassistant/components/camera/xiaomi.py @@ -104,20 +104,16 @@ class XiaomiCamera(Camera): dirs = [d for d in ftp.nlst() if '.' not in d] if not dirs: - if self._model == MODEL_YI: - _LOGGER.warning("There don't appear to be any uploaded videos") - return False - elif self._model == MODEL_XIAOFANG: - _LOGGER.warning("There don't appear to be any folders") - return False - - first_dir = dirs[-1] - try: - ftp.cwd(first_dir) - except error_perm as exc: - _LOGGER.error('Unable to find path: %s - %s', first_dir, exc) - return False + _LOGGER.warning("There don't appear to be any folders") + return False + first_dir = dirs[-1] + try: + ftp.cwd(first_dir) + 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")