mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
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,7 +6,7 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/lektrico",
|
"documentation": "https://www.home-assistant.io/integrations/lektrico",
|
||||||
"integration_type": "device",
|
"integration_type": "device",
|
||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"requirements": ["lektricowifi==0.0.41"],
|
"requirements": ["lektricowifi==0.0.42"],
|
||||||
"zeroconf": [
|
"zeroconf": [
|
||||||
{
|
{
|
||||||
"type": "_http._tcp.local.",
|
"type": "_http._tcp.local.",
|
||||||
|
@ -41,6 +41,21 @@ class LektricoSensorEntityDescription(SensorEntityDescription):
|
|||||||
value_fn: Callable[[dict[str, Any]], StateType]
|
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, ...] = (
|
SENSORS_FOR_CHARGERS: tuple[LektricoSensorEntityDescription, ...] = (
|
||||||
LektricoSensorEntityDescription(
|
LektricoSensorEntityDescription(
|
||||||
key="state",
|
key="state",
|
||||||
@ -104,17 +119,12 @@ SENSORS_FOR_CHARGERS: tuple[LektricoSensorEntityDescription, ...] = (
|
|||||||
key="limit_reason",
|
key="limit_reason",
|
||||||
translation_key="limit_reason",
|
translation_key="limit_reason",
|
||||||
device_class=SensorDeviceClass.ENUM,
|
device_class=SensorDeviceClass.ENUM,
|
||||||
options=[
|
options=LIMIT_REASON_OPTIONS,
|
||||||
"no_limit",
|
value_fn=lambda data: (
|
||||||
"installation_current",
|
str(data["current_limit_reason"])
|
||||||
"user_limit",
|
if str(data["current_limit_reason"]) in LIMIT_REASON_OPTIONS
|
||||||
"dynamic_limit",
|
else None
|
||||||
"schedule",
|
),
|
||||||
"em_offline",
|
|
||||||
"em",
|
|
||||||
"ocpp",
|
|
||||||
],
|
|
||||||
value_fn=lambda data: str(data["current_limit_reason"]),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -70,7 +70,10 @@
|
|||||||
"schedule": "Schedule",
|
"schedule": "Schedule",
|
||||||
"em_offline": "EM offline",
|
"em_offline": "EM offline",
|
||||||
"em": "EM",
|
"em": "EM",
|
||||||
"ocpp": "OCPP"
|
"ocpp": "OCPP",
|
||||||
|
"overtemperature": "Overtemperature",
|
||||||
|
"switching_phases": "Switching phases",
|
||||||
|
"1p_charging_disabled": "1p charging disabled"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"breaker_current": {
|
"breaker_current": {
|
||||||
|
@ -1270,7 +1270,7 @@ leaone-ble==0.1.0
|
|||||||
led-ble==1.0.2
|
led-ble==1.0.2
|
||||||
|
|
||||||
# homeassistant.components.lektrico
|
# homeassistant.components.lektrico
|
||||||
lektricowifi==0.0.41
|
lektricowifi==0.0.42
|
||||||
|
|
||||||
# homeassistant.components.foscam
|
# homeassistant.components.foscam
|
||||||
libpyfoscam==1.2.2
|
libpyfoscam==1.2.2
|
||||||
|
@ -1066,7 +1066,7 @@ leaone-ble==0.1.0
|
|||||||
led-ble==1.0.2
|
led-ble==1.0.2
|
||||||
|
|
||||||
# homeassistant.components.lektrico
|
# homeassistant.components.lektrico
|
||||||
lektricowifi==0.0.41
|
lektricowifi==0.0.42
|
||||||
|
|
||||||
# homeassistant.components.foscam
|
# homeassistant.components.foscam
|
||||||
libpyfoscam==1.2.2
|
libpyfoscam==1.2.2
|
||||||
|
@ -260,6 +260,9 @@
|
|||||||
'em_offline',
|
'em_offline',
|
||||||
'em',
|
'em',
|
||||||
'ocpp',
|
'ocpp',
|
||||||
|
'overtemperature',
|
||||||
|
'switching_phases',
|
||||||
|
'1p_charging_disabled',
|
||||||
]),
|
]),
|
||||||
}),
|
}),
|
||||||
'config_entry_id': <ANY>,
|
'config_entry_id': <ANY>,
|
||||||
@ -303,6 +306,9 @@
|
|||||||
'em_offline',
|
'em_offline',
|
||||||
'em',
|
'em',
|
||||||
'ocpp',
|
'ocpp',
|
||||||
|
'overtemperature',
|
||||||
|
'switching_phases',
|
||||||
|
'1p_charging_disabled',
|
||||||
]),
|
]),
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user