mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Add BMW tire pressure sensors (#120949)
This commit is contained in:
parent
48145c1a7d
commit
131d9ec51b
@ -23,6 +23,7 @@ from homeassistant.const import (
|
|||||||
STATE_UNKNOWN,
|
STATE_UNKNOWN,
|
||||||
UnitOfElectricCurrent,
|
UnitOfElectricCurrent,
|
||||||
UnitOfLength,
|
UnitOfLength,
|
||||||
|
UnitOfPressure,
|
||||||
UnitOfVolume,
|
UnitOfVolume,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
@ -44,6 +45,8 @@ class BMWSensorEntityDescription(SensorEntityDescription):
|
|||||||
is_available: Callable[[MyBMWVehicle], bool] = lambda v: v.is_lsc_enabled
|
is_available: Callable[[MyBMWVehicle], bool] = lambda v: v.is_lsc_enabled
|
||||||
|
|
||||||
|
|
||||||
|
TIRES = ["front_left", "front_right", "rear_left", "rear_right"]
|
||||||
|
|
||||||
SENSOR_TYPES: list[BMWSensorEntityDescription] = [
|
SENSOR_TYPES: list[BMWSensorEntityDescription] = [
|
||||||
BMWSensorEntityDescription(
|
BMWSensorEntityDescription(
|
||||||
key="charging_profile.ac_current_limit",
|
key="charging_profile.ac_current_limit",
|
||||||
@ -153,6 +156,33 @@ SENSOR_TYPES: list[BMWSensorEntityDescription] = [
|
|||||||
],
|
],
|
||||||
is_available=lambda v: v.is_remote_climate_stop_enabled,
|
is_available=lambda v: v.is_remote_climate_stop_enabled,
|
||||||
),
|
),
|
||||||
|
*[
|
||||||
|
BMWSensorEntityDescription(
|
||||||
|
key=f"tires.{tire}.current_pressure",
|
||||||
|
translation_key=f"{tire}_current_pressure",
|
||||||
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
|
native_unit_of_measurement=UnitOfPressure.KPA,
|
||||||
|
suggested_unit_of_measurement=UnitOfPressure.BAR,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
suggested_display_precision=2,
|
||||||
|
is_available=lambda v: v.is_lsc_enabled and v.tires is not None,
|
||||||
|
)
|
||||||
|
for tire in TIRES
|
||||||
|
],
|
||||||
|
*[
|
||||||
|
BMWSensorEntityDescription(
|
||||||
|
key=f"tires.{tire}.target_pressure",
|
||||||
|
translation_key=f"{tire}_target_pressure",
|
||||||
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
|
native_unit_of_measurement=UnitOfPressure.KPA,
|
||||||
|
suggested_unit_of_measurement=UnitOfPressure.BAR,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
suggested_display_precision=2,
|
||||||
|
entity_registry_enabled_default=False,
|
||||||
|
is_available=lambda v: v.is_lsc_enabled and v.tires is not None,
|
||||||
|
)
|
||||||
|
for tire in TIRES
|
||||||
|
],
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -149,6 +149,30 @@
|
|||||||
"inactive": "Inactive",
|
"inactive": "Inactive",
|
||||||
"standby": "Standby"
|
"standby": "Standby"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"front_left_current_pressure": {
|
||||||
|
"name": "Front left tire pressure"
|
||||||
|
},
|
||||||
|
"front_right_current_pressure": {
|
||||||
|
"name": "Front right tire pressure"
|
||||||
|
},
|
||||||
|
"rear_left_current_pressure": {
|
||||||
|
"name": "Rear left tire pressure"
|
||||||
|
},
|
||||||
|
"rear_right_current_pressure": {
|
||||||
|
"name": "Rear right tire pressure"
|
||||||
|
},
|
||||||
|
"front_left_target_pressure": {
|
||||||
|
"name": "Front left target pressure"
|
||||||
|
},
|
||||||
|
"front_right_target_pressure": {
|
||||||
|
"name": "Front right target pressure"
|
||||||
|
},
|
||||||
|
"rear_left_target_pressure": {
|
||||||
|
"name": "Rear left target pressure"
|
||||||
|
},
|
||||||
|
"rear_right_target_pressure": {
|
||||||
|
"name": "Rear right target pressure"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"switch": {
|
"switch": {
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user