From 6215e27de4ac8ddc391ce9bead38614fd1c6f08d Mon Sep 17 00:00:00 2001 From: celeroll Date: Fri, 18 Aug 2017 19:59:20 +0200 Subject: [PATCH] Fix Geizhals index issue when not 4 prices available (#9035) * Out of index issue, when not 4 prices are available * Removed the parenthesis, to fix the lint error. --- homeassistant/components/sensor/geizhals.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/sensor/geizhals.py b/homeassistant/components/sensor/geizhals.py index 5ba64dfa995..94f3f1884d1 100644 --- a/homeassistant/components/sensor/geizhals.py +++ b/homeassistant/components/sensor/geizhals.py @@ -80,6 +80,8 @@ class Geizwatch(Entity): @property def device_state_attributes(self): """Return the state attributes.""" + while len(self.data.prices) < 4: + self.data.prices.append("None") attrs = {'device_name': self.data.device_name, 'description': self.description, 'unit_of_measurement': self.data.unit_of_measurement,