Skip to content

Commit

Permalink
Improve device name
Browse files Browse the repository at this point in the history
  • Loading branch information
jdejaegh committed May 28, 2024
1 parent 2579b79 commit 2e90931
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions custom_components/irm_kmi/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,10 @@
'alder': 'mdi:tree', 'ash': 'mdi:tree', 'birch': 'mdi:tree', 'grasses': 'mdi:grass', 'hazel': 'mdi:tree',
'mugwort': 'mdi:sprout', 'oak': 'mdi:tree'
}

IRM_KMI_NAME: Final = {
'fr': 'Institut Royal Météorologique de Belgique',
'nl': 'Koninklijk Meteorologisch Instituut van België',
'de': 'Königliche Meteorologische Institut von Belgien',
'en': 'Royal Meteorological Institute of Belgium'
}
4 changes: 2 additions & 2 deletions custom_components/irm_kmi/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from homeassistant.util.dt import utcnow

from .api import IrmKmiApiClient, IrmKmiApiError
from .const import CONF_DARK_MODE, CONF_STYLE, DOMAIN
from .const import CONF_DARK_MODE, CONF_STYLE, DOMAIN, IRM_KMI_NAME
from .const import IRM_KMI_TO_HA_CONDITION_MAP as CDT_MAP
from .const import MAP_WARNING_ID_TO_SLUG as SLUG_MAP
from .const import OPTION_STYLE_SATELLITE, OUT_OF_BENELUX, STYLE_TO_PARAM_MAP
Expand Down Expand Up @@ -52,7 +52,7 @@ def __init__(self, hass: HomeAssistant, entry: ConfigEntry):
self.shared_device_info = DeviceInfo(
entry_type=DeviceEntryType.SERVICE,
identifiers={(DOMAIN, entry.entry_id)},
manufacturer="IRM KMI",
manufacturer=IRM_KMI_NAME.get(preferred_language(self.hass, self._config_entry)),
name=f"{entry.title}"
)

Expand Down

0 comments on commit 2e90931

Please sign in to comment.