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

Classes

class  SubaruSensor
 

Functions

None _async_migrate_entries (HomeAssistant hass, ConfigEntry config_entry)
 
None async_setup_entry (HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
 
list[SubaruSensorcreate_vehicle_sensors (vehicle_info, DataUpdateCoordinator coordinator)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
list API_GEN_2_SENSORS
 
list API_GEN_3_SENSORS
 
list EV_SENSORS
 
string FUEL_CONSUMPTION_LITERS_PER_HUNDRED_KILOMETERS = "L/100km"
 
string FUEL_CONSUMPTION_MILES_PER_GALLON = "mi/gal"
 
 KM_PER_MI = DistanceConverter.convert(1, UnitOfLength.MILES, UnitOfLength.KILOMETERS)
 
 L_PER_GAL = VolumeConverter.convert(1, UnitOfVolume.GALLONS, UnitOfVolume.LITERS)
 
list SAFETY_SENSORS
 

Detailed Description

Support for Subaru sensors.

Function Documentation

◆ _async_migrate_entries()

None homeassistant.components.subaru.sensor._async_migrate_entries ( HomeAssistant  hass,
ConfigEntry   config_entry 
)
private
Migrate sensor entries from HA<=2022.10 to use preferred unique_id.

Definition at line 237 of file sensor.py.

◆ async_setup_entry()

None homeassistant.components.subaru.sensor.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  config_entry,
AddEntitiesCallback  async_add_entities 
)
Set up the Subaru sensors by config_entry.

Definition at line 141 of file sensor.py.

◆ create_vehicle_sensors()

list[SubaruSensor] homeassistant.components.subaru.sensor.create_vehicle_sensors (   vehicle_info,
DataUpdateCoordinator   coordinator 
)
Instantiate all available sensors for the vehicle.

Definition at line 157 of file sensor.py.

Variable Documentation

◆ _LOGGER

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

Definition at line 41 of file sensor.py.

◆ API_GEN_2_SENSORS

list homeassistant.components.subaru.sensor.API_GEN_2_SENSORS

Definition at line 63 of file sensor.py.

◆ API_GEN_3_SENSORS

list homeassistant.components.subaru.sensor.API_GEN_3_SENSORS
Initial value:
1 = [
2  SensorEntityDescription(
3  key=sc.REMAINING_FUEL_PERCENT,
4  translation_key="fuel_level",
5  native_unit_of_measurement=PERCENTAGE,
6  state_class=SensorStateClass.MEASUREMENT,
7  ),
8 ]

Definition at line 108 of file sensor.py.

◆ EV_SENSORS

list homeassistant.components.subaru.sensor.EV_SENSORS
Initial value:
1 = [
2  SensorEntityDescription(
3  key=sc.EV_DISTANCE_TO_EMPTY,
4  translation_key="ev_range",
5  device_class=SensorDeviceClass.DISTANCE,
6  native_unit_of_measurement=UnitOfLength.MILES,
7  state_class=SensorStateClass.MEASUREMENT,
8  ),
9  SensorEntityDescription(
10  key=sc.EV_STATE_OF_CHARGE_PERCENT,
11  translation_key="ev_battery_level",
12  device_class=SensorDeviceClass.BATTERY,
13  native_unit_of_measurement=PERCENTAGE,
14  state_class=SensorStateClass.MEASUREMENT,
15  ),
16  SensorEntityDescription(
17  key=sc.EV_TIME_TO_FULLY_CHARGED_UTC,
18  translation_key="ev_time_to_full_charge",
19  device_class=SensorDeviceClass.TIMESTAMP,
20  ),
21 ]

Definition at line 118 of file sensor.py.

◆ FUEL_CONSUMPTION_LITERS_PER_HUNDRED_KILOMETERS

string homeassistant.components.subaru.sensor.FUEL_CONSUMPTION_LITERS_PER_HUNDRED_KILOMETERS = "L/100km"

Definition at line 45 of file sensor.py.

◆ FUEL_CONSUMPTION_MILES_PER_GALLON

string homeassistant.components.subaru.sensor.FUEL_CONSUMPTION_MILES_PER_GALLON = "mi/gal"

Definition at line 46 of file sensor.py.

◆ KM_PER_MI

homeassistant.components.subaru.sensor.KM_PER_MI = DistanceConverter.convert(1, UnitOfLength.MILES, UnitOfLength.KILOMETERS)

Definition at line 49 of file sensor.py.

◆ L_PER_GAL

homeassistant.components.subaru.sensor.L_PER_GAL = VolumeConverter.convert(1, UnitOfVolume.GALLONS, UnitOfVolume.LITERS)

Definition at line 48 of file sensor.py.

◆ SAFETY_SENSORS

list homeassistant.components.subaru.sensor.SAFETY_SENSORS
Initial value:
1 = [
2  SensorEntityDescription(
3  key=sc.ODOMETER,
4  translation_key="odometer",
5  device_class=SensorDeviceClass.DISTANCE,
6  native_unit_of_measurement=UnitOfLength.MILES,
7  state_class=SensorStateClass.TOTAL_INCREASING,
8  ),
9 ]

Definition at line 52 of file sensor.py.