Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.trend.binary_sensor Namespace Reference

Classes

class  SensorTrend
 

Functions

dict[str, Any] _validate_min_max (dict[str, Any] data)
 
None async_setup_entry (HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)
 
None async_setup_platform (HomeAssistant hass, ConfigType config, AddEntitiesCallback async_add_entities, DiscoveryInfoType|None discovery_info=None)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
 PLATFORM_SCHEMA
 
 SENSOR_SCHEMA
 

Detailed Description

A sensor that monitors trends in other components.

Function Documentation

◆ _validate_min_max()

dict[str, Any] homeassistant.components.trend.binary_sensor._validate_min_max ( dict[str, Any]  data)
private

Definition at line 68 of file binary_sensor.py.

◆ async_setup_entry()

None homeassistant.components.trend.binary_sensor.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  entry,
AddEntitiesCallback  async_add_entities 
)
Set up trend sensor from config entry.

Definition at line 131 of file binary_sensor.py.

◆ async_setup_platform()

None homeassistant.components.trend.binary_sensor.async_setup_platform ( HomeAssistant  hass,
ConfigType  config,
AddEntitiesCallback  async_add_entities,
DiscoveryInfoType | None   discovery_info = None 
)
Set up the trend sensors.

Definition at line 100 of file binary_sensor.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.trend.binary_sensor._LOGGER = logging.getLogger(__name__)
private

Definition at line 65 of file binary_sensor.py.

◆ PLATFORM_SCHEMA

homeassistant.components.trend.binary_sensor.PLATFORM_SCHEMA
Initial value:
1 = BINARY_SENSOR_PLATFORM_SCHEMA.extend(
2  {vol.Required(CONF_SENSORS): cv.schema_with_slug_keys(SENSOR_SCHEMA)}
3 )

Definition at line 95 of file binary_sensor.py.

◆ SENSOR_SCHEMA

homeassistant.components.trend.binary_sensor.SENSOR_SCHEMA
Initial value:
1 = vol.All(
2  vol.Schema(
3  {
4  vol.Required(CONF_ENTITY_ID): cv.entity_id,
5  vol.Optional(CONF_ATTRIBUTE): cv.string,
6  vol.Optional(CONF_DEVICE_CLASS): DEVICE_CLASSES_SCHEMA,
7  vol.Optional(CONF_FRIENDLY_NAME): cv.string,
8  vol.Optional(CONF_INVERT, default=False): cv.boolean,
9  vol.Optional(CONF_MAX_SAMPLES, default=2): cv.positive_int,
10  vol.Optional(CONF_MIN_GRADIENT, default=0.0): vol.Coerce(float),
11  vol.Optional(CONF_SAMPLE_DURATION, default=0): cv.positive_int,
12  vol.Optional(CONF_MIN_SAMPLES, default=2): cv.positive_int,
13  }
14  ),
15  _validate_min_max,
16 )

Definition at line 78 of file binary_sensor.py.