1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Cleanup climate platform for async update_ha_state / migrate generic thermostat (#5679)

* Cleanup climate from blocking stuff / migrate generic

* Migrate generic thermostat

* fix tests

* fix lint
This commit is contained in:
Pascal Vizeli
2017-02-02 06:44:05 +01:00
committed by Paulus Schoutsen
parent 647a93801c
commit 10a104271e
8 changed files with 79 additions and 49 deletions

View File

@@ -199,7 +199,10 @@ numeric_state_from_config = _threaded_factory(async_numeric_state_from_config)
def state(hass, entity, req_state, for_period=None):
"""Test if state matches requirements."""
"""Test if state matches requirements.
Async friendly.
"""
if isinstance(entity, str):
entity = hass.states.get(entity)
@@ -357,7 +360,7 @@ def time_from_config(config, config_validation=True):
def zone(hass, zone_ent, entity):
"""Test if zone-condition matches.
Can be run async.
Async friendly.
"""
if isinstance(zone_ent, str):
zone_ent = hass.states.get(zone_ent)