mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Fix bug in rest sensor
This commit is contained in:
parent
3e51d0b539
commit
496ec4bcca
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user