From 253dee8e4d432836be8727a32f0bfeaba9364901 Mon Sep 17 00:00:00 2001 From: Thibault Cohen Date: Mon, 13 Mar 2017 13:54:23 -0400 Subject: [PATCH] Fix hydroquebec (#6574) --- homeassistant/components/sensor/hydroquebec.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/sensor/hydroquebec.py b/homeassistant/components/sensor/hydroquebec.py index 7ec2b17af2d..aa35d5d7659 100644 --- a/homeassistant/components/sensor/hydroquebec.py +++ b/homeassistant/components/sensor/hydroquebec.py @@ -149,7 +149,8 @@ class HydroQuebecSensor(Entity): def update(self): """Get the latest data from Hydroquebec and update the state.""" self.hydroquebec_data.update() - self._state = round(self.hydroquebec_data.data[self.type], 2) + if self.type in self.hydroquebec_data.data: + self._state = round(self.hydroquebec_data.data[self.type], 2) class HydroquebecData(object):