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

Classes

class  ThresholdSensor
 

Functions

str _threshold_type (float|None lower, float|None upper)
 
None async_setup_entry (HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
 
None async_setup_platform (HomeAssistant hass, ConfigType config, AddEntitiesCallback async_add_entities, DiscoveryInfoType|None discovery_info=None)
 
dict no_missing_threshold (dict value)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
 Final
 
 PLATFORM_SCHEMA
 

Detailed Description

Support for monitoring if a sensor value is below/above a threshold.

Function Documentation

◆ _threshold_type()

str homeassistant.components.threshold.binary_sensor._threshold_type ( float | None  lower,
float | None  upper 
)
private
Return the type of threshold this sensor represents.

Definition at line 152 of file binary_sensor.py.

◆ async_setup_entry()

None homeassistant.components.threshold.binary_sensor.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  config_entry,
AddEntitiesCallback  async_add_entities 
)
Initialize threshold config entry.

Definition at line 90 of file binary_sensor.py.

◆ async_setup_platform()

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

Definition at line 129 of file binary_sensor.py.

◆ no_missing_threshold()

dict homeassistant.components.threshold.binary_sensor.no_missing_threshold ( dict  value)
Validate data point list is greater than polynomial degrees.

Definition at line 65 of file binary_sensor.py.

Variable Documentation

◆ _LOGGER

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

Definition at line 60 of file binary_sensor.py.

◆ Final

homeassistant.components.threshold.binary_sensor.Final

Definition at line 62 of file binary_sensor.py.

◆ PLATFORM_SCHEMA

homeassistant.components.threshold.binary_sensor.PLATFORM_SCHEMA
Initial value:
1 = vol.All(
2  BINARY_SENSOR_PLATFORM_SCHEMA.extend(
3  {
4  vol.Required(CONF_ENTITY_ID): cv.entity_id,
5  vol.Optional(CONF_DEVICE_CLASS): DEVICE_CLASSES_SCHEMA,
6  vol.Optional(CONF_HYSTERESIS, default=DEFAULT_HYSTERESIS): vol.Coerce(
7  float
8  ),
9  vol.Optional(CONF_LOWER): vol.Coerce(float),
10  vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
11  vol.Optional(CONF_UPPER): vol.Coerce(float),
12  }
13  ),
14  no_missing_threshold,
15 )

Definition at line 73 of file binary_sensor.py.