Add new values for sensor for Lektrico integration (#126210)
* Add new values for sensor limit_reason. * Remove unknown from limit reason sensor.
This commit is contained in:
parent
3f13f6ed12
commit
f4b324bbad
6 changed files with 34 additions and 15 deletions
|
@ -6,7 +6,7 @@
|
|||
"documentation": "https://www.home-assistant.io/integrations/lektrico",
|
||||
"integration_type": "device",
|
||||
"iot_class": "local_polling",
|
||||
"requirements": ["lektricowifi==0.0.41"],
|
||||
"requirements": ["lektricowifi==0.0.42"],
|
||||
"zeroconf": [
|
||||
{
|
||||
"type": "_http._tcp.local.",
|
||||
|
|
|
@ -41,6 +41,21 @@ class LektricoSensorEntityDescription(SensorEntityDescription):
|
|||
value_fn: Callable[[dict[str, Any]], StateType]
|
||||
|
||||
|
||||
LIMIT_REASON_OPTIONS = [
|
||||
"no_limit",
|
||||
"installation_current",
|
||||
"user_limit",
|
||||
"dynamic_limit",
|
||||
"schedule",
|
||||
"em_offline",
|
||||
"em",
|
||||
"ocpp",
|
||||
"overtemperature",
|
||||
"switching_phases",
|
||||
"1p_charging_disabled",
|
||||
]
|
||||
|
||||
|
||||
SENSORS_FOR_CHARGERS: tuple[LektricoSensorEntityDescription, ...] = (
|
||||
LektricoSensorEntityDescription(
|
||||
key="state",
|
||||
|
@ -104,17 +119,12 @@ SENSORS_FOR_CHARGERS: tuple[LektricoSensorEntityDescription, ...] = (
|
|||
key="limit_reason",
|
||||
translation_key="limit_reason",
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
options=[
|
||||
"no_limit",
|
||||
"installation_current",
|
||||
"user_limit",
|
||||
"dynamic_limit",
|
||||
"schedule",
|
||||
"em_offline",
|
||||
"em",
|
||||
"ocpp",
|
||||
],
|
||||
value_fn=lambda data: str(data["current_limit_reason"]),
|
||||
options=LIMIT_REASON_OPTIONS,
|
||||
value_fn=lambda data: (
|
||||
str(data["current_limit_reason"])
|
||||
if str(data["current_limit_reason"]) in LIMIT_REASON_OPTIONS
|
||||
else None
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
@ -70,7 +70,10 @@
|
|||
"schedule": "Schedule",
|
||||
"em_offline": "EM offline",
|
||||
"em": "EM",
|
||||
"ocpp": "OCPP"
|
||||
"ocpp": "OCPP",
|
||||
"overtemperature": "Overtemperature",
|
||||
"switching_phases": "Switching phases",
|
||||
"1p_charging_disabled": "1p charging disabled"
|
||||
}
|
||||
},
|
||||
"breaker_current": {
|
||||
|
|
|
@ -1270,7 +1270,7 @@ leaone-ble==0.1.0
|
|||
led-ble==1.0.2
|
||||
|
||||
# homeassistant.components.lektrico
|
||||
lektricowifi==0.0.41
|
||||
lektricowifi==0.0.42
|
||||
|
||||
# homeassistant.components.foscam
|
||||
libpyfoscam==1.2.2
|
||||
|
|
|
@ -1066,7 +1066,7 @@ leaone-ble==0.1.0
|
|||
led-ble==1.0.2
|
||||
|
||||
# homeassistant.components.lektrico
|
||||
lektricowifi==0.0.41
|
||||
lektricowifi==0.0.42
|
||||
|
||||
# homeassistant.components.foscam
|
||||
libpyfoscam==1.2.2
|
||||
|
|
|
@ -260,6 +260,9 @@
|
|||
'em_offline',
|
||||
'em',
|
||||
'ocpp',
|
||||
'overtemperature',
|
||||
'switching_phases',
|
||||
'1p_charging_disabled',
|
||||
]),
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
|
@ -303,6 +306,9 @@
|
|||
'em_offline',
|
||||
'em',
|
||||
'ocpp',
|
||||
'overtemperature',
|
||||
'switching_phases',
|
||||
'1p_charging_disabled',
|
||||
]),
|
||||
}),
|
||||
'context': <ANY>,
|
||||
|
|
Loading…
Add table
Reference in a new issue