From 496ec4bccaffa9f02e535aa0283c7b7bbca9a409 Mon Sep 17 00:00:00 2001 From: Philip Lundrigan Date: Wed, 23 Dec 2015 03:37:03 -0700 Subject: [PATCH] Fix bug in rest sensor --- homeassistant/components/sensor/rest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/sensor/rest.py b/homeassistant/components/sensor/rest.py index a6b5c518eee..abb6b439a84 100644 --- a/homeassistant/components/sensor/rest.py +++ b/homeassistant/components/sensor/rest.py @@ -126,7 +126,7 @@ class RestDataGet(object): try: response = requests.get(self._resource, timeout=10, verify=self._verify_ssl) - if 'error' in self.data: + if isinstance(self.data, dict) and 'error' in self.data: del self.data['error'] self.data = response.text except requests.exceptions.ConnectionError: @@ -150,7 +150,7 @@ class RestDataPost(object): try: response = requests.post(self._resource, data=self._payload, timeout=10, verify=self._verify_ssl) - if 'error' in self.data: + if isinstance(self.data, dict) and 'error' in self.data: del self.data['error'] self.data = response.text except requests.exceptions.ConnectionError: