From a29be5455c9a0c68c6f3fec54961659ab1d08ff7 Mon Sep 17 00:00:00 2001
From: John Arild Berentsen <turbokongen@hotmail.com>
Date: Sat, 13 Feb 2016 09:05:18 +0100
Subject: [PATCH] Fix unit and wrong errorhandling

---
 homeassistant/components/sensor/verisure.py | 5 +----
 homeassistant/components/verisure.py        | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/homeassistant/components/sensor/verisure.py b/homeassistant/components/sensor/verisure.py
index f7e80e27549..1ba750aa3e9 100644
--- a/homeassistant/components/sensor/verisure.py
+++ b/homeassistant/components/sensor/verisure.py
@@ -128,10 +128,7 @@ class VerisureMouseDetection(Entity):
     @property
     def unit_of_measurement(self):
         """ Unit of measurement of this entity """
-        if verisure.MOUSEDETECTION_STATUS[self._id].count >= 1:
-            return "Mice"
-        else:
-            return "Mouse"
+        return "Mice"
 
     def update(self):
         """ update sensor """
diff --git a/homeassistant/components/verisure.py b/homeassistant/components/verisure.py
index e85ee5d7850..841339863ca 100644
--- a/homeassistant/components/verisure.py
+++ b/homeassistant/components/verisure.py
@@ -164,7 +164,7 @@ def update_component(get_function, status):
         for overview in get_function():
             try:
                 status[overview.id] = overview
-            except IndexError:
+            except AttributeError:
                 status[overview.deviceLabel] = overview
     except (ConnectionError, VERISURE_ERROR) as ex:
         _LOGGER.error('Caught connection error %s, tries to reconnect', ex)
-- 
GitLab