From c8fa6cc12778339e221b02244f6ff5376a391d22 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 27 Dec 2015 21:47:49 +0100 Subject: [PATCH] bug fix --- homeassistant/components/tellduslive.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/tellduslive.py b/homeassistant/components/tellduslive.py index 3c5c135ba3f..5c314032b27 100644 --- a/homeassistant/components/tellduslive.py +++ b/homeassistant/components/tellduslive.py @@ -116,7 +116,8 @@ class TelldusLiveData(object): def check_request(self, what, **params): """ Make request, check result if successful """ - return self._request(what, **params) == "success" + response = self._request(what, **params) + return response['status'] == "success" def validate_session(self): """ Make a dummy request to see if the session is valid """ @@ -164,7 +165,8 @@ class TelldusLiveData(object): def get_switch_state(self, switch_id): """ returns state of switch. """ _LOGGER.info("Updating switch state from Telldus Live") - return int(self._request("device/info", id=switch_id)["state"]) + response = self._request("device/info", id=switch_id)["state"] + return int(response) def turn_switch_on(self, switch_id): """ turn switch off """