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

Classes

class  APCUPSdSensor
 

Functions

None async_setup_entry (HomeAssistant hass, APCUPSdConfigEntry config_entry, AddEntitiesCallback async_add_entities)
 
tuple[str, str|None] infer_unit (str value)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
 device_class
 
 entity_registry_enabled_default
 
dictionary INFERRED_UNITS
 
 key
 
 native_unit_of_measurement
 
int PARALLEL_UPDATES = 0
 
 state_class
 
 translation_key
 

Detailed Description

Support for APCUPSd sensors.

Function Documentation

◆ async_setup_entry()

None homeassistant.components.apcupsd.sensor.async_setup_entry ( HomeAssistant  hass,
APCUPSdConfigEntry  config_entry,
AddEntitiesCallback  async_add_entities 
)
Set up the APCUPSd sensors from config entries.

Definition at line 407 of file sensor.py.

◆ infer_unit()

tuple[str, str | None] homeassistant.components.apcupsd.sensor.infer_unit ( str  value)
If the value ends with any of the units from supported units.

Split the unit off the end of the value and return the value, unit tuple
pair. Else return the original value and None as the unit.

Definition at line 435 of file sensor.py.

Variable Documentation

◆ _LOGGER

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

Definition at line 33 of file sensor.py.

◆ device_class

homeassistant.components.apcupsd.sensor.device_class

Definition at line 44 of file sensor.py.

◆ entity_registry_enabled_default

homeassistant.components.apcupsd.sensor.entity_registry_enabled_default

Definition at line 50 of file sensor.py.

◆ INFERRED_UNITS

dictionary homeassistant.components.apcupsd.sensor.INFERRED_UNITS
Initial value:
1 = {
2  " Minutes": UnitOfTime.MINUTES,
3  " Seconds": UnitOfTime.SECONDS,
4  " Percent": PERCENTAGE,
5  " Volts": UnitOfElectricPotential.VOLT,
6  " Ampere": UnitOfElectricCurrent.AMPERE,
7  " Amps": UnitOfElectricCurrent.AMPERE,
8  " Volt-Ampere": UnitOfApparentPower.VOLT_AMPERE,
9  " VA": UnitOfApparentPower.VOLT_AMPERE,
10  " Watts": UnitOfPower.WATT,
11  " Hz": UnitOfFrequency.HERTZ,
12  " C": UnitOfTemperature.CELSIUS,
13  # APCUPSd reports data for "itemp" field (eventually represented by UPS Internal
14  # Temperature sensor in this integration) with a trailing "Internal", e.g.,
15  # "34.6 C Internal". Here we create a fake unit " C Internal" to handle this case.
16  " C Internal": UnitOfTemperature.CELSIUS,
17  " Percent Load Capacity": PERCENTAGE,
18  # "stesti" field (Self Test Interval) field could report a "days" unit, e.g.,
19  # "7 days", so here we add support for it.
20  " days": UnitOfTime.DAYS,
21 }

Definition at line 384 of file sensor.py.

◆ key

homeassistant.components.apcupsd.sensor.key

Definition at line 37 of file sensor.py.

◆ native_unit_of_measurement

homeassistant.components.apcupsd.sensor.native_unit_of_measurement

Definition at line 43 of file sensor.py.

◆ PARALLEL_UPDATES

int homeassistant.components.apcupsd.sensor.PARALLEL_UPDATES = 0

Definition at line 31 of file sensor.py.

◆ state_class

homeassistant.components.apcupsd.sensor.state_class

Definition at line 45 of file sensor.py.

◆ translation_key

homeassistant.components.apcupsd.sensor.translation_key

Definition at line 38 of file sensor.py.