Async syntax 1, alarm_control_panel & automation & binary_sensor (#17015)
This commit is contained in:
1 parent
750c96709e
commit
38e371c5d9
39 files changed
+109
-220
No files matched your search
@@ -4,7 +4,6 @@ Support for monitoring if a sensor value is below/above a threshold.
|
||||
For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/sensor.threshold/
|
||||
"""
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
import voluptuous as vol
|
||||
@@ -54,9 +53,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
})
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def async_setup_platform(hass, config, async_add_entities,
|
||||
discovery_info=None):
|
||||
async def async_setup_platform(hass, config, async_add_entities,
|
||||
discovery_info=None):
|
||||
"""Set up the Threshold sensor."""
|
||||
entity_id = config.get(CONF_ENTITY_ID)
|
||||
name = config.get(CONF_NAME)
|
||||
@@ -147,8 +145,7 @@ class ThresholdSensor(BinarySensorDevice):
|
||||
ATTR_UPPER: self._threshold_upper,
|
||||
}
|
||||
|
||||
@asyncio.coroutine
|
||||
def async_update(self):
|
||||
async def async_update(self):
|
||||
"""Get the latest data and updates the states."""
|
||||
def below(threshold):
|
||||
"""Determine if the sensor value is below a threshold."""
|
||||
|
||||
Reference in new issue
Block a user