mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Fix Freebox call sensor when no call in history (#40001)
This commit is contained in:
parent
285408b46c
commit
13df452dd4
@ -146,11 +146,12 @@ class FreeboxCallSensor(FreeboxSensor):
|
|||||||
def async_update_state(self) -> None:
|
def async_update_state(self) -> None:
|
||||||
"""Update the Freebox call sensor."""
|
"""Update the Freebox call sensor."""
|
||||||
self._call_list_for_type = []
|
self._call_list_for_type = []
|
||||||
for call in self._router.call_list:
|
if self._router.call_list:
|
||||||
if not call["new"]:
|
for call in self._router.call_list:
|
||||||
continue
|
if not call["new"]:
|
||||||
if call["type"] == self._sensor_type:
|
continue
|
||||||
self._call_list_for_type.append(call)
|
if call["type"] == self._sensor_type:
|
||||||
|
self._call_list_for_type.append(call)
|
||||||
|
|
||||||
self._state = len(self._call_list_for_type)
|
self._state = len(self._call_list_for_type)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user