diff --git a/homeassistant/components/lektrico/manifest.json b/homeassistant/components/lektrico/manifest.json index 5aef09f3845..d96b8cc4b69 100644 --- a/homeassistant/components/lektrico/manifest.json +++ b/homeassistant/components/lektrico/manifest.json @@ -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.", diff --git a/homeassistant/components/lektrico/sensor.py b/homeassistant/components/lektrico/sensor.py index a8a929d974f..a26a3676d8b 100644 --- a/homeassistant/components/lektrico/sensor.py +++ b/homeassistant/components/lektrico/sensor.py @@ -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 + ), ), ) diff --git a/homeassistant/components/lektrico/strings.json b/homeassistant/components/lektrico/strings.json index a636ee543e6..3f4a732a4a0 100644 --- a/homeassistant/components/lektrico/strings.json +++ b/homeassistant/components/lektrico/strings.json @@ -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": { diff --git a/requirements_all.txt b/requirements_all.txt index 49a263f4490..e26b3f69c9b 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -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 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 70fd537a685..09cd1fe57b1 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -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 diff --git a/tests/components/lektrico/snapshots/test_sensor.ambr b/tests/components/lektrico/snapshots/test_sensor.ambr index 7df5df70218..002e0b00ca8 100644 --- a/tests/components/lektrico/snapshots/test_sensor.ambr +++ b/tests/components/lektrico/snapshots/test_sensor.ambr @@ -260,6 +260,9 @@ 'em_offline', 'em', 'ocpp', + 'overtemperature', + 'switching_phases', + '1p_charging_disabled', ]), }), 'config_entry_id': , @@ -303,6 +306,9 @@ 'em_offline', 'em', 'ocpp', + 'overtemperature', + 'switching_phases', + '1p_charging_disabled', ]), }), 'context': ,