Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.sensor Namespace Reference

Namespaces

 const
 
 device_condition
 
 device_trigger
 
 helpers
 
 recorder
 
 significant_change
 
 websocket_api
 

Classes

class  RestoreSensor
 
class  SensorEntity
 
class  SensorEntityDescription
 
class  SensorExtraStoredData
 

Functions

int|None _display_precision (HomeAssistant hass, str entity_id)
 
bool _numeric_state_expected (SensorDeviceClass|None device_class, SensorStateClass|str|None state_class, str|None native_unit_of_measurement, int|None suggested_display_precision)
 
str async_rounded_state (HomeAssistant hass, str entity_id, State state)
 
bool async_setup (HomeAssistant hass, ConfigType config)
 
bool async_setup_entry (HomeAssistant hass, ConfigEntry entry)
 
bool async_unload_entry (HomeAssistant hass, ConfigEntry entry)
 
None async_update_suggested_units (HomeAssistant hass)
 

Variables

 __all__
 
 __dir__
 
 __getattr__
 
 CACHED_PROPERTIES_WITH_ATTR_
 
 check_if_deprecated_constant
 
 dir_with_deprecated_constants
 
 Final
 
 module_globals
 
 module_globals_keys
 
 PLATFORM_SCHEMA
 
 PLATFORM_SCHEMA_BASE
 
 seconds
 
 TEMPERATURE_UNITS
 

Detailed Description

Component to interface with various sensors that can be monitored.

Function Documentation

◆ _display_precision()

int | None homeassistant.components.sensor._display_precision ( HomeAssistant  hass,
str  entity_id 
)
private
Return the display precision.

Definition at line 959 of file __init__.py.

◆ _numeric_state_expected()

bool homeassistant.components.sensor._numeric_state_expected ( SensorDeviceClass | None  device_class,
SensorStateClass | str | None  state_class,
str | None  native_unit_of_measurement,
int | None  suggested_display_precision 
)
private
Return true if the sensor must be numeric.

Definition at line 154 of file __init__.py.

◆ async_rounded_state()

str homeassistant.components.sensor.async_rounded_state ( HomeAssistant  hass,
str  entity_id,
State  state 
)
Return the state rounded for presentation.

Definition at line 971 of file __init__.py.

◆ async_setup()

bool homeassistant.components.sensor.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Track states and offer events for sensors.

Definition at line 120 of file __init__.py.

◆ async_setup_entry()

bool homeassistant.components.sensor.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Set up a config entry.

Definition at line 131 of file __init__.py.

◆ async_unload_entry()

bool homeassistant.components.sensor.async_unload_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Unload a config entry.

Definition at line 136 of file __init__.py.

◆ async_update_suggested_units()

None homeassistant.components.sensor.async_update_suggested_units ( HomeAssistant  hass)
Update the suggested_unit_of_measurement according to the unit system.

Definition at line 942 of file __init__.py.

Variable Documentation

◆ __all__

homeassistant.components.sensor.__all__
private

Definition at line 100 of file __init__.py.

◆ __dir__

homeassistant.components.sensor.__dir__
private

Definition at line 988 of file __init__.py.

◆ __getattr__

homeassistant.components.sensor.__getattr__
private

Definition at line 987 of file __init__.py.

◆ CACHED_PROPERTIES_WITH_ATTR_

homeassistant.components.sensor.CACHED_PROPERTIES_WITH_ATTR_

Definition at line 176 of file __init__.py.

◆ check_if_deprecated_constant

homeassistant.components.sensor.check_if_deprecated_constant

Definition at line 987 of file __init__.py.

◆ dir_with_deprecated_constants

homeassistant.components.sensor.dir_with_deprecated_constants

Definition at line 989 of file __init__.py.

◆ Final

homeassistant.components.sensor.Final

Definition at line 92 of file __init__.py.

◆ module_globals

homeassistant.components.sensor.module_globals

Definition at line 987 of file __init__.py.

◆ module_globals_keys

homeassistant.components.sensor.module_globals_keys

Definition at line 989 of file __init__.py.

◆ PLATFORM_SCHEMA

homeassistant.components.sensor.PLATFORM_SCHEMA

Definition at line 96 of file __init__.py.

◆ PLATFORM_SCHEMA_BASE

homeassistant.components.sensor.PLATFORM_SCHEMA_BASE

Definition at line 97 of file __init__.py.

◆ seconds

homeassistant.components.sensor.seconds

Definition at line 98 of file __init__.py.

◆ TEMPERATURE_UNITS

homeassistant.components.sensor.TEMPERATURE_UNITS

Definition at line 187 of file __init__.py.