From a0f2f3814b22fd792eeb1d84d252f81abac1d32a Mon Sep 17 00:00:00 2001 From: Per Sandstrom Date: Sun, 16 Aug 2015 06:51:09 +0200 Subject: [PATCH] fixed flak8 --- homeassistant/components/switch/verisure.py | 10 +++++----- homeassistant/components/verisure.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/switch/verisure.py b/homeassistant/components/switch/verisure.py index 52182bf94a9..cc331f12fdb 100644 --- a/homeassistant/components/switch/verisure.py +++ b/homeassistant/components/switch/verisure.py @@ -42,8 +42,8 @@ class VerisureSmartplug(SwitchDevice): """ Represents a Verisure smartplug. """ def __init__(self, smartplug_status): self._id = smartplug_status.id - self.STATUS_ON = verisure.MY_PAGES.SMARTPLUG_ON - self.STATUS_OFF = verisure.MY_PAGES.SMARTPLUG_OFF + self.status_off = verisure.MY_PAGES.SMARTPLUG_ON + self.status_off = verisure.MY_PAGES.SMARTPLUG_OFF @property def name(self): @@ -54,19 +54,19 @@ class VerisureSmartplug(SwitchDevice): def is_on(self): """ Returns True if on """ plug_status = verisure.get_smartplug_status()[self._id].status - return plug_status == self.STATUS_ON + return plug_status == self.status_off def turn_on(self): """ Set smartplug status on """ verisure.MY_PAGES.set_smartplug_status( self._id, - self.STATUS_ON) + self.status_on) def turn_off(self): """ Set smartplug status off. """ verisure.MY_PAGES.set_smartplug_status( self._id, - self.STATUS_OFF) + self.status_off) def update(self): verisure.update() diff --git a/homeassistant/components/verisure.py b/homeassistant/components/verisure.py index 6e0d6a81539..18a7701a3ab 100644 --- a/homeassistant/components/verisure.py +++ b/homeassistant/components/verisure.py @@ -64,7 +64,7 @@ def setup(hass, config): try: MY_PAGES.login() except (ConnectionError, Error) as ex: - _LOGGER.error('Could not log in to verisure mypages, %s', ex.message) + _LOGGER.error('Could not log in to verisure mypages, %s', ex) return False update() @@ -102,11 +102,11 @@ def reconnect(): try: MY_PAGES.login() except VERISURE_LOGIN_ERROR as ex: - _LOGGER.error("Could not login to Verisure mypages, %s", ex.message) + _LOGGER.error("Could not login to Verisure mypages, %s", ex) global WRONG_PASSWORD_GIVEN WRONG_PASSWORD_GIVEN = True except (ConnectionError, VERISURE_ERROR) as ex: - _LOGGER.error("Could not login to Verisure mypages, %s", ex.message) + _LOGGER.error("Could not login to Verisure mypages, %s", ex) @Throttle(MIN_TIME_BETWEEN_REQUESTS)