mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Add AC current limit and Pre entry climatization (#92688)
* Add AC current limit and Pre entry climatization Additional information available for EVs * Add pre entry climatization * Fix mypy error * Change for black and mypy
This commit is contained in:
parent
16c915864b
commit
8c67e96e38
@ -189,6 +189,14 @@ SENSOR_TYPES: tuple[BMWBinarySensorEntityDescription, ...] = (
|
|||||||
icon="mdi:car-electric",
|
icon="mdi:car-electric",
|
||||||
value_fn=lambda v: v.fuel_and_battery.is_charger_connected,
|
value_fn=lambda v: v.fuel_and_battery.is_charger_connected,
|
||||||
),
|
),
|
||||||
|
BMWBinarySensorEntityDescription(
|
||||||
|
key="is_pre_entry_climatization_enabled",
|
||||||
|
name="Pre entry climatization",
|
||||||
|
icon="mdi:car-seat-heater",
|
||||||
|
value_fn=lambda v: v.charging_profile.is_pre_entry_climatization_enabled
|
||||||
|
if v.charging_profile
|
||||||
|
else False,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ from homeassistant.components.sensor import (
|
|||||||
SensorEntityDescription,
|
SensorEntityDescription,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import LENGTH, PERCENTAGE, VOLUME
|
from homeassistant.const import LENGTH, PERCENTAGE, VOLUME, UnitOfElectricCurrent
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.typing import StateType
|
from homeassistant.helpers.typing import StateType
|
||||||
@ -53,6 +53,14 @@ def convert_and_round(
|
|||||||
|
|
||||||
SENSOR_TYPES: dict[str, BMWSensorEntityDescription] = {
|
SENSOR_TYPES: dict[str, BMWSensorEntityDescription] = {
|
||||||
# --- Generic ---
|
# --- Generic ---
|
||||||
|
"ac_current_limit": BMWSensorEntityDescription(
|
||||||
|
key="ac_current_limit",
|
||||||
|
name="AC current limit",
|
||||||
|
key_class="charging_profile",
|
||||||
|
unit_type=UnitOfElectricCurrent.AMPERE,
|
||||||
|
icon="mdi:current-ac",
|
||||||
|
entity_registry_enabled_default=False,
|
||||||
|
),
|
||||||
"charging_start_time": BMWSensorEntityDescription(
|
"charging_start_time": BMWSensorEntityDescription(
|
||||||
key="charging_start_time",
|
key="charging_start_time",
|
||||||
name="Charging start time",
|
name="Charging start time",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user