diff --git a/custom_components/myskoda/sensor.py b/custom_components/myskoda/sensor.py index a782f1d..941dd72 100644 --- a/custom_components/myskoda/sensor.py +++ b/custom_components/myskoda/sensor.py @@ -253,21 +253,25 @@ class ChargingState(ChargingSensor): device_class=SensorDeviceClass.ENUM, translation_key="charging_state", ) + + # lower_snake_case for translations _attr_options = [ - "CONNECT_CABLE", - "READY_FOR_CHARGING", - "CONSERVING", - "CHARGING", + "connect_cable", + "ready_for_charging", + "conserving", + "charging", ] @property def native_value(self): # noqa: D102 - return self._status().state + return str(self._status().state).lower() @property def icon(self): # noqa: D102 if self._status().state == charging.ChargingState.CONNECT_CABLE: return "mdi:power-plug-off" + if self._status().state == charging.ChargingState.CHARGING: + return "mdi:power-plug-battery" return "mdi:power-plug" diff --git a/custom_components/myskoda/translations/en.json b/custom_components/myskoda/translations/en.json index 480a323..9bfa766 100644 --- a/custom_components/myskoda/translations/en.json +++ b/custom_components/myskoda/translations/en.json @@ -17,6 +17,19 @@ } } }, + "entity": { + "sensor": { + "charging_state": { + "name": "Charging State", + "state": { + "connect_cable": "Cable Disconnected", + "ready_for_charging": "Ready for Charging", + "conserving": "Conserving Charge", + "charging": "Charging" + } + } + } + }, "options": { "step": { "init": {