Skip to content

Commit

Permalink
Bumped abodepy version. Bumped pylint version to fix tox build.
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterWil committed Apr 5, 2018
1 parent b88f297 commit aa8c6db
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions .pytest_cache/v/cache/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/nodeids
6 changes: 2 additions & 4 deletions abodepy/devices/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ def color(self):
@property
def has_brightness(self):
"""Device has brightness."""
if self.brightness:
return True
return self.brightness

@property
def has_color(self):
Expand All @@ -36,5 +35,4 @@ def has_color(self):
@property
def is_dimmable(self):
"""Device is dimmable."""
if 'Dimmer' in self._type:
return True
return 'Dimmer' in self._type
4 changes: 4 additions & 0 deletions abodepy/devices/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def _get_numeric_status(self, key):

if value and any(i.isdigit() for i in value):
return float(re.sub("[^0-9.]", "", value))
return None

@property
def temp(self):
Expand All @@ -46,6 +47,7 @@ def temp_unit(self):
return CONST.UNIT_FAHRENHEIT
elif CONST.UNIT_CELSIUS in self._get_status(CONST.TEMP_STATUS_KEY):
return CONST.UNIT_CELSIUS
return None

@property
def humidity(self):
Expand All @@ -57,6 +59,7 @@ def humidity_unit(self):
"""Get unit of humidity."""
if CONST.UNIT_PERCENT in self._get_status(CONST.HUMI_STATUS_KEY):
return CONST.UNIT_PERCENT
return None

@property
def lux(self):
Expand All @@ -68,6 +71,7 @@ def lux_unit(self):
"""Get unit of lux."""
if CONST.UNIT_LUX in self._get_status(CONST.LUX_STATUS_KEY):
return CONST.LUX
return None

@property
def has_temp(self):
Expand Down
15 changes: 8 additions & 7 deletions abodepy/event_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
from socketIO_client import SocketIO, LoggingNamespace
from socketIO_client.exceptions import SocketIOError

from urllib3.exceptions import HTTPError

from abodepy.devices import AbodeDevice
from abodepy.exceptions import AbodeException
import abodepy.helpers.constants as CONST
import abodepy.helpers.errors as ERROR
import abodepy.helpers.timeline as TIMELINE
from urllib3.exceptions import HTTPError

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -263,7 +264,7 @@ def _clear_internal_socketio(self):
# pylint: disable=w0703
except Exception as exc:
_LOGGER.warning(
"Caught exception clearing SocketIO object: " + str(exc))
"Caught exception clearing SocketIO object: %s", str(exc))

def _run_socketio_thread(self):
self._running = True
Expand Down Expand Up @@ -307,20 +308,20 @@ def _run_socketio_thread(self):
break
except SocketIOError as exc:
_LOGGER.info(
"SocketIO error: " + str(exc))
"SocketIO error: %s", str(exc))
time.sleep(5)
except ConnectionError as exc:
_LOGGER.info("Connection error: " + str(exc))
_LOGGER.info("Connection error: %s", str(exc))
time.sleep(5)
except HTTPError as exc:
_LOGGER.info("HTTP error: " + str(exc))
_LOGGER.info("HTTP error: %s", str(exc))
time.sleep(5)
except OSError as exc:
_LOGGER.info("OS error: " + str(exc))
_LOGGER.info("OS error: %s", str(exc))
time.sleep(5)
except Exception as exc:
_LOGGER.warning(
"Unknown exception in SocketIO thread: " + str(exc))
"Unknown exception in SocketIO thread: %s", str(exc))
self._running = False
raise
finally:
Expand Down
2 changes: 1 addition & 1 deletion abodepy/helpers/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

MAJOR_VERSION = 0
MINOR_VERSION = 12
PATCH_VERSION = '2'
PATCH_VERSION = '3'

__version__ = '{}.{}.{}'.format(MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION)

Expand Down
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
flake8==3.3
flake8-docstrings==1.1.0
pylint==1.7.1
pylint==1.8.2
pydocstyle==2.0.0
pytest>=2.9.2
pytest-cov>=2.3.1
Expand Down

0 comments on commit aa8c6db

Please sign in to comment.