From efe8b465760e025b1fac35ceb0d7bdf82c6d9a01 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 23 Apr 2017 09:24:26 +0200 Subject: [PATCH] Upgrade pygatt to 3.1.1 (#7220) * Upgrade pygatt to 3.1.1 * Fix mess --- homeassistant/components/sensor/skybeacon.py | 14 +++++++------- requirements_all.txt | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/sensor/skybeacon.py b/homeassistant/components/sensor/skybeacon.py index dd6a117d447..0e8e2c6d2e9 100644 --- a/homeassistant/components/sensor/skybeacon.py +++ b/homeassistant/components/sensor/skybeacon.py @@ -16,7 +16,7 @@ from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_NAME, CONF_MAC, TEMP_CELSIUS, STATE_UNKNOWN, EVENT_HOMEASSISTANT_STOP) -REQUIREMENTS = ['pygatt==3.0.0'] +REQUIREMENTS = ['pygatt==3.1.1'] _LOGGER = logging.getLogger(__name__) @@ -38,7 +38,7 @@ CONNECT_TIMEOUT = 30 # pylint: disable=unused-argument def setup_platform(hass, config, add_devices, discovery_info=None): - """Set up the sensor.""" + """Set up the Skybeacon sensor.""" name = config.get(CONF_NAME) mac = config.get(CONF_MAC) _LOGGER.debug("Setting up...") @@ -57,7 +57,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): class SkybeaconHumid(Entity): - """Representation of a humidity sensor.""" + """Representation of a Skybeacon humidity sensor.""" def __init__(self, name, mon): """Initialize a sensor.""" @@ -89,7 +89,7 @@ class SkybeaconHumid(Entity): class SkybeaconTemp(Entity): - """Representation of a temperature sensor.""" + """Representation of a Skybeacon temperature sensor.""" def __init__(self, name, mon): """Initialize a sensor.""" @@ -146,9 +146,9 @@ class Monitor(threading.Thread): while True: try: _LOGGER.info("Connecting to %s", self.name) - # we need concurrent connect, so lets not reset the device + # We need concurrent connect, so lets not reset the device adapter.start(reset_on_start=False) - # seems only one connection can be initiated at a time + # Seems only one connection can be initiated at a time with CONNECT_LOCK: device = adapter.connect(self.mac, CONNECT_TIMEOUT, @@ -157,7 +157,7 @@ class Monitor(threading.Thread): # HACK: inject handle mapping collected offline # pylint: disable=protected-access device._characteristics[UUID(BLE_TEMP_UUID)] = cached_char - # magic: writing this makes device happy + # Magic: writing this makes device happy device.char_write_handle(0x1b, bytearray([255]), False) device.subscribe(BLE_TEMP_UUID, self._update) _LOGGER.info("Subscribed to %s", self.name) diff --git a/requirements_all.txt b/requirements_all.txt index 9c3789b24b1..41df2f8221e 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -534,7 +534,7 @@ pyfido==1.0.1 pyfttt==0.3 # homeassistant.components.sensor.skybeacon -pygatt==3.0.0 +pygatt==3.1.1 # homeassistant.components.remote.harmony pyharmony==1.0.12