From 48c86e07faf63d03644a211a0d2ea2290a7576b3 Mon Sep 17 00:00:00 2001 From: Maciej Bieniek Date: Mon, 23 Oct 2017 08:02:20 +0200 Subject: [PATCH 1/5] fix gateway illumination sensor value (#10045) --- homeassistant/components/sensor/xiaomi_aqara.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/homeassistant/components/sensor/xiaomi_aqara.py b/homeassistant/components/sensor/xiaomi_aqara.py index f375f1ba9ad..7b771e8c785 100644 --- a/homeassistant/components/sensor/xiaomi_aqara.py +++ b/homeassistant/components/sensor/xiaomi_aqara.py @@ -75,8 +75,6 @@ class XiaomiSensor(XiaomiDevice): return False elif self._data_key == 'humidity' and (value <= 0 or value > 100): return False - elif self._data_key == 'illumination' and value == 0: - return False elif self._data_key == 'pressure' and value == 0: return False self._state = round(value, 2) From ed82f23da38f9663f55b32f05046b235bf5da9bd Mon Sep 17 00:00:00 2001 From: Teemu R Date: Mon, 23 Oct 2017 09:41:47 +0200 Subject: [PATCH 2/5] switch.tplink: fix overlooked issue with statically defined names (#10053) --- homeassistant/components/switch/tplink.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/switch/tplink.py b/homeassistant/components/switch/tplink.py index df0050ff979..8fa6493862c 100644 --- a/homeassistant/components/switch/tplink.py +++ b/homeassistant/components/switch/tplink.py @@ -45,7 +45,7 @@ class SmartPlugSwitch(SwitchDevice): def __init__(self, smartplug, name): """Initialize the switch.""" self.smartplug = smartplug - self._name = None + self._name = name self._state = None # Set up emeter cache self._emeter_params = {} From 97943361135b54b1a8595b6e92b9849d09db7eda Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Mon, 23 Oct 2017 08:58:02 +0200 Subject: [PATCH 3/5] Remove warning --- homeassistant/helpers/entity_component.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/homeassistant/helpers/entity_component.py b/homeassistant/helpers/entity_component.py index e805f277483..f6e9c1da7f8 100644 --- a/homeassistant/helpers/entity_component.py +++ b/homeassistant/helpers/entity_component.py @@ -370,12 +370,6 @@ class EntityPlatform(object): def add_entities(self, new_entities, update_before_add=False): """Add entities for a single platform.""" - # That avoid deadlocks - if update_before_add: - self.component.logger.warning( - "Call 'add_entities' with update_before_add=True " - "only inside tests or you can run into a deadlock!") - run_coroutine_threadsafe( self.async_add_entities(list(new_entities), update_before_add), self.component.hass.loop).result() From 32f58baa854048edc0bf089a8d380c7bafed8693 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 23 Oct 2017 13:49:04 +0200 Subject: [PATCH 4/5] Fix merge conflict --- homeassistant/components/automation/event.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/automation/event.py b/homeassistant/components/automation/event.py index 90baeaded14..d8c32fde86d 100644 --- a/homeassistant/components/automation/event.py +++ b/homeassistant/components/automation/event.py @@ -31,7 +31,7 @@ def async_trigger(hass, config, action): event_type = config.get(CONF_EVENT_TYPE) event_data_schema = vol.Schema( config.get(CONF_EVENT_DATA), - extra=vol.ALLOW_EXTRA) + extra=vol.ALLOW_EXTRA) if config.get(CONF_EVENT_DATA) else None @callback def handle_event(event): From 79d71c6727eb05e7d332fcde824118f289d53d26 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 23 Oct 2017 13:50:11 +0200 Subject: [PATCH 5/5] Version bump to 0.56.2 --- homeassistant/components/automation/event.py | 11 ++++++----- homeassistant/const.py | 2 +- homeassistant/helpers/entity_component.py | 6 ++++++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/automation/event.py b/homeassistant/components/automation/event.py index d8c32fde86d..6f750245df9 100644 --- a/homeassistant/components/automation/event.py +++ b/homeassistant/components/automation/event.py @@ -36,11 +36,12 @@ def async_trigger(hass, config, action): @callback def handle_event(event): """Listen for events and calls the action when data matches.""" - try: - event_data_schema(event.data) - except vol.Invalid: - # If event data doesn't match requested schema, skip event - return + if event_data_schema: + try: + event_data_schema(event.data) + except vol.Invalid: + # If event data doesn't match requested schema, skip event + return hass.async_run_job(action, { 'trigger': { diff --git a/homeassistant/const.py b/homeassistant/const.py index ca438f35102..3a2ee824dda 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,7 +2,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 56 -PATCH_VERSION = '1' +PATCH_VERSION = '2' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 4, 2) diff --git a/homeassistant/helpers/entity_component.py b/homeassistant/helpers/entity_component.py index f6e9c1da7f8..e805f277483 100644 --- a/homeassistant/helpers/entity_component.py +++ b/homeassistant/helpers/entity_component.py @@ -370,6 +370,12 @@ class EntityPlatform(object): def add_entities(self, new_entities, update_before_add=False): """Add entities for a single platform.""" + # That avoid deadlocks + if update_before_add: + self.component.logger.warning( + "Call 'add_entities' with update_before_add=True " + "only inside tests or you can run into a deadlock!") + run_coroutine_threadsafe( self.async_add_entities(list(new_entities), update_before_add), self.component.hass.loop).result()