diff --git a/custom_components/easee/const.py b/custom_components/easee/const.py index daf0777d..fd8ff196 100644 --- a/custom_components/easee/const.py +++ b/custom_components/easee/const.py @@ -99,7 +99,7 @@ ], "units": None, "convert_units_func": None, - "device_class": None, + "device_class": "easee_status", "icon": "mdi:ev-station", }, "total_power": { diff --git a/custom_components/easee/entity.py b/custom_components/easee/entity.py index bce6186f..47304c26 100644 --- a/custom_components/easee/entity.py +++ b/custom_components/easee/entity.py @@ -8,6 +8,7 @@ from homeassistant.helpers import entity_registry, device_registry from homeassistant.helpers.entity_registry import async_entries_for_device from homeassistant.helpers.entity import Entity +from homeassistant.helpers.translation import async_get_translations from homeassistant.util import dt from homeassistant.const import DEVICE_CLASS_POWER @@ -79,6 +80,7 @@ def __init__( async def async_added_to_hass(self) -> None: """Entity created.""" + self.hass.data[DOMAIN]["entities"].append({self._entity_name: self.entity_id}) async def async_will_remove_from_hass(self) -> None: diff --git a/custom_components/easee/translations/sensor.en.json b/custom_components/easee/translations/sensor.en.json new file mode 100644 index 00000000..a9dd6fb6 --- /dev/null +++ b/custom_components/easee/translations/sensor.en.json @@ -0,0 +1,12 @@ +{ + "state": { + "easee_status": { + "STANDBY": "Standby", + "PAUSED": "Paused", + "READY_TO_CHARGE": "Ready to charge", + "CAR_CONNECTED": "Car connected", + "CHARGING": "Charging", + "ERROR": "Error" + } + } +} \ No newline at end of file diff --git a/custom_components/easee/translations/sensor.nb.json b/custom_components/easee/translations/sensor.nb.json new file mode 100644 index 00000000..f43fc94e --- /dev/null +++ b/custom_components/easee/translations/sensor.nb.json @@ -0,0 +1,12 @@ +{ + "state": { + "easee_status": { + "STANDBY": "Ventemodus", + "PAUSED": "Pause", + "READY_TO_CHARGE": "Klar til lading", + "CAR_CONNECTED": "Bil tilkoblet", + "CHARGING": "Lader", + "ERROR": "Feil" + } + } +} diff --git a/custom_components/easee/translations/sensor.sv.json b/custom_components/easee/translations/sensor.sv.json new file mode 100644 index 00000000..91cd1ddc --- /dev/null +++ b/custom_components/easee/translations/sensor.sv.json @@ -0,0 +1,12 @@ +{ + "state": { + "easee_status": { + "STANDBY": "Redo", + "PAUSED": "Paus", + "READY_TO_CHARGE": "Redo att ladda", + "CAR_CONNECTED": "Bil ansluten", + "CHARGING": "Laddar", + "ERROR": "Fel" + } + } +}