From 86bbfb00ad34ed01c76f7bb4d551a0a81a7d8779 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 30 Jul 2016 12:43:17 -0700 Subject: [PATCH 01/10] Version bump to 0.25 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 5d745765fb7..60985fca23e 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -1,7 +1,7 @@ # coding: utf-8 """Constants used by Home Assistant components.""" -__version__ = "0.25.0.dev0" +__version__ = "0.25.0" REQUIRED_PYTHON_VER = (3, 4) PLATFORM_FORMAT = '{}.{}' From ecfcc1fd41cc205a462ac921c12d5fcba95575c0 Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Sat, 30 Jul 2016 13:03:54 -0700 Subject: [PATCH 02/10] Update authorship information Sorry @balloob :) --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 54867d5264e..6a7da9f70bb 100755 --- a/setup.py +++ b/setup.py @@ -27,8 +27,8 @@ setup( license='MIT License', url='https://home-assistant.io/', download_url=DOWNLOAD_URL, - author='Paulus Schoutsen', - author_email='paulus@paulusschoutsen.nl', + author='Home Assistant', + author_email='hello@home-assistant.io', description='Open-source home automation platform running on Python 3.', packages=PACKAGES, include_package_data=True, From 3686a5ed561e291d266359997f0f90e2aa213513 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 30 Jul 2016 19:30:56 -0700 Subject: [PATCH 03/10] Try to deflake discovery tests --- tests/helpers/test_discovery.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/tests/helpers/test_discovery.py b/tests/helpers/test_discovery.py index b6f9ed5dec8..d7d9d629d9a 100644 --- a/tests/helpers/test_discovery.py +++ b/tests/helpers/test_discovery.py @@ -1,15 +1,10 @@ """Test discovery helpers.""" -import os - from unittest.mock import patch -from homeassistant import loader, bootstrap, config as config_util +from homeassistant import loader, bootstrap from homeassistant.helpers import discovery -from tests.common import (get_test_home_assistant, get_test_config_dir, - MockModule, MockPlatform) - -VERSION_PATH = os.path.join(get_test_config_dir(), config_util.VERSION_FILE) +from tests.common import get_test_home_assistant, MockModule, MockPlatform class TestHelpersDiscovery: @@ -17,15 +12,12 @@ class TestHelpersDiscovery: def setup_method(self, method): """Setup things to be run when tests are started.""" - self.hass = get_test_home_assistant() + self.hass = get_test_home_assistant(1) def teardown_method(self, method): """Stop everything that was started.""" self.hass.stop() - if os.path.isfile(VERSION_PATH): - os.remove(VERSION_PATH) - @patch('homeassistant.bootstrap.setup_component') def test_listen(self, mock_setup_component): """Test discovery listen/discover combo.""" @@ -105,14 +97,15 @@ class TestHelpersDiscovery: def component_setup(hass, config): """Setup mock component.""" - discovery.load_platform(hass, 'switch', 'test_circular') + discovery.load_platform(hass, 'switch', 'test_circular', 'disc', + config) component_calls.append(1) return True def setup_platform(hass, config, add_devices_callback, discovery_info=None): """Setup mock platform.""" - platform_calls.append(1) + platform_calls.append('disc' if discovery_info else 'component') loader.set_component( 'test_component', @@ -123,13 +116,12 @@ class TestHelpersDiscovery: MockPlatform(setup_platform, dependencies=['test_component'])) - bootstrap.from_config_dict({ + bootstrap.setup_component(self.hass, 'test_component', { 'test_component': None, 'switch': [{ 'platform': 'test_circular', }], - }, self.hass) - + }) self.hass.pool.block_till_done() assert 'test_component' in self.hass.config.components From a81a8c2bdf246f62474f5bce34f8848fb0228d3f Mon Sep 17 00:00:00 2001 From: Jesse Newland Date: Sun, 31 Jul 2016 02:09:01 -0500 Subject: [PATCH 04/10] Bring back delayed zwave value update behavior (#2674) --- homeassistant/components/light/zwave.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/light/zwave.py b/homeassistant/components/light/zwave.py index ab41381f5e7..1be5aba1cda 100644 --- a/homeassistant/components/light/zwave.py +++ b/homeassistant/components/light/zwave.py @@ -8,6 +8,7 @@ import logging # Because we do not compile openzwave on CI # pylint: disable=import-error +from threading import Timer from homeassistant.components.light import ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, \ ATTR_RGB_COLOR, DOMAIN, Light from homeassistant.components import zwave @@ -108,7 +109,22 @@ class ZwaveDimmer(zwave.ZWaveDeviceEntity, Light): """Called when a value has changed on the network.""" if self._value.value_id == value.value_id or \ self._value.node == value.node: - self.update_properties() + + if self._refreshing: + self._refreshing = False + self.update_properties() + else: + def _refresh_value(): + """Used timer callback for delayed value refresh.""" + self._refreshing = True + self._value.refresh() + + if self._timer is not None and self._timer.isAlive(): + self._timer.cancel() + + self._timer = Timer(2, _refresh_value) + self._timer.start() + self.update_ha_state() @property From 74f284d2d78870d6f74bb4e8ac795dcabcf7a398 Mon Sep 17 00:00:00 2001 From: Johann Kellerman Date: Sun, 31 Jul 2016 19:10:30 +0200 Subject: [PATCH 05/10] Close session after execute. (#2677) --- homeassistant/components/recorder/__init__.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/recorder/__init__.py b/homeassistant/components/recorder/__init__.py index 781736d3c6a..f5ce7118d01 100644 --- a/homeassistant/components/recorder/__init__.py +++ b/homeassistant/components/recorder/__init__.py @@ -58,14 +58,17 @@ def execute(q): This method also retries a few times in the case of stale connections. """ import sqlalchemy.exc - for _ in range(0, RETRIES): - try: - return [ - row for row in - (row.to_native() for row in q) - if row is not None] - except sqlalchemy.exc.SQLAlchemyError as e: - log_error(e, retry_wait=QUERY_RETRY_WAIT, rollback=True) + try: + for _ in range(0, RETRIES): + try: + return [ + row for row in + (row.to_native() for row in q) + if row is not None] + except sqlalchemy.exc.SQLAlchemyError as e: + log_error(e, retry_wait=QUERY_RETRY_WAIT, rollback=True) + finally: + Session().close() return [] From ba721663334eba00da1ada8e3309b1532bd312c3 Mon Sep 17 00:00:00 2001 From: Stephen Hoekstra Date: Sun, 31 Jul 2016 22:47:24 +0200 Subject: [PATCH 06/10] Add 5 second timeout to Kodi connections (#2683) --- homeassistant/components/media_player/kodi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/media_player/kodi.py b/homeassistant/components/media_player/kodi.py index 3af270a05b0..e28d84417d6 100644 --- a/homeassistant/components/media_player/kodi.py +++ b/homeassistant/components/media_player/kodi.py @@ -53,7 +53,8 @@ class KodiDevice(MediaPlayerDevice): self._url = url self._server = jsonrpc_requests.Server( '{}/jsonrpc'.format(self._url), - auth=auth) + auth=auth, + timeout=5) self._turn_off_action = turn_off_action self._players = list() self._properties = None From 628eacc83e54e7bee27a9061c5321cc4ea514ee4 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 31 Jul 2016 17:20:08 -0700 Subject: [PATCH 07/10] Rollback voluptuous to 0.8.9 (#2687) --- requirements_all.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements_all.txt b/requirements_all.txt index ab861c8f941..582bc60c9d8 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -4,7 +4,7 @@ pyyaml>=3.11,<4 pytz>=2016.6.1 pip>=7.0.0 jinja2>=2.8 -voluptuous==0.9.1 +voluptuous==0.8.9 typing>=3,<4 sqlalchemy==1.0.14 diff --git a/setup.py b/setup.py index 6a7da9f70bb..7a9c1333230 100755 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ REQUIRES = [ 'pytz>=2016.6.1', 'pip>=7.0.0', 'jinja2>=2.8', - 'voluptuous==0.9.1', + 'voluptuous==0.8.9', 'typing>=3,<4', 'sqlalchemy==1.0.14', ] From 08e694cac3e0199510bb0ddb72f5a2e1ec97f8ec Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 31 Jul 2016 17:21:24 -0700 Subject: [PATCH 08/10] Version bump to 0.25.1 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 60985fca23e..9e32d537255 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -1,7 +1,7 @@ # coding: utf-8 """Constants used by Home Assistant components.""" -__version__ = "0.25.0" +__version__ = "0.25.1" REQUIRED_PYTHON_VER = (3, 4) PLATFORM_FORMAT = '{}.{}' From b51ba85a15c0b406bbff9aa4313545d42fb8acd9 Mon Sep 17 00:00:00 2001 From: Tobie Booth Date: Mon, 1 Aug 2016 10:08:24 -0500 Subject: [PATCH 09/10] Reverts changes to ZWave lock status update (#2595) (#2696) --- homeassistant/components/lock/zwave.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homeassistant/components/lock/zwave.py b/homeassistant/components/lock/zwave.py index 7416d5c439b..9a3b24deb8a 100644 --- a/homeassistant/components/lock/zwave.py +++ b/homeassistant/components/lock/zwave.py @@ -46,8 +46,7 @@ class ZwaveLock(zwave.ZWaveDeviceEntity, LockDevice): def _value_changed(self, value): """Called when a value has changed on the network.""" - if self._value.value_id == value.value_id or \ - self._value.node == value.node: + if self._value.value_id == value.value_id: self._state = value.data self.update_ha_state() From b1b14f0e83c9a2bf3b9805767fb379fc11020d86 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 1 Aug 2016 20:56:59 -0700 Subject: [PATCH 10/10] Version bump to 0.25.2 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 9e32d537255..64ce733f4ec 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -1,7 +1,7 @@ # coding: utf-8 """Constants used by Home Assistant components.""" -__version__ = "0.25.1" +__version__ = "0.25.2" REQUIRED_PYTHON_VER = (3, 4) PLATFORM_FORMAT = '{}.{}'