From 13df452dd4c1641dcf96ac67b0af37ff7d14a805 Mon Sep 17 00:00:00 2001 From: Quentame Date: Sun, 13 Sep 2020 01:13:57 +0200 Subject: [PATCH] Fix Freebox call sensor when no call in history (#40001) --- homeassistant/components/freebox/sensor.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/freebox/sensor.py b/homeassistant/components/freebox/sensor.py index dc0d808c438..aeeaba438ff 100644 --- a/homeassistant/components/freebox/sensor.py +++ b/homeassistant/components/freebox/sensor.py @@ -146,11 +146,12 @@ class FreeboxCallSensor(FreeboxSensor): def async_update_state(self) -> None: """Update the Freebox call sensor.""" self._call_list_for_type = [] - for call in self._router.call_list: - if not call["new"]: - continue - if call["type"] == self._sensor_type: - self._call_list_for_type.append(call) + if self._router.call_list: + for call in self._router.call_list: + if not call["new"]: + continue + if call["type"] == self._sensor_type: + self._call_list_for_type.append(call) self._state = len(self._call_list_for_type)