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

Classes

class  EnergyCostSensor
 
class  SensorManager
 
class  SourceAdapter
 

Functions

None _set_result_unless_done (asyncio.Future[None] future)
 
None async_setup_platform (HomeAssistant hass, ConfigType config, AddEntitiesCallback async_add_entities, DiscoveryInfoType|None discovery_info=None)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
dictionary SUPPORTED_STATE_CLASSES
 
dictionary VALID_ENERGY_UNITS_GAS
 

Detailed Description

Helper sensor for calculating utility costs.

Function Documentation

◆ _set_result_unless_done()

None homeassistant.components.energy.sensor._set_result_unless_done ( asyncio.Future[None]  future)
private
Set the result of a future unless it is done.

Definition at line 220 of file sensor.py.

◆ async_setup_platform()

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

Definition at line 67 of file sensor.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.energy.sensor._LOGGER = logging.getLogger(__name__)
private

Definition at line 64 of file sensor.py.

◆ SUPPORTED_STATE_CLASSES

dictionary homeassistant.components.energy.sensor.SUPPORTED_STATE_CLASSES
Initial value:
1 = {
2  SensorStateClass.MEASUREMENT,
3  SensorStateClass.TOTAL,
4  SensorStateClass.TOTAL_INCREASING,
5 }

Definition at line 39 of file sensor.py.

◆ VALID_ENERGY_UNITS_GAS

dictionary homeassistant.components.energy.sensor.VALID_ENERGY_UNITS_GAS
Initial value:
1 = {
2  UnitOfVolume.CENTUM_CUBIC_FEET,
3  UnitOfVolume.CUBIC_FEET,
4  UnitOfVolume.CUBIC_METERS,
5  *VALID_ENERGY_UNITS,
6 }

Definition at line 51 of file sensor.py.