Skip to content

Commit

Permalink
Added Dutch translation to entities
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGos committed May 12, 2024
1 parent 43e6647 commit 8e92368
Show file tree
Hide file tree
Showing 5 changed files with 490 additions and 89 deletions.
11 changes: 3 additions & 8 deletions custom_components/davis_vantage/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
DESCRIPTIONS: list[BinarySensorEntityDescription] = [
BinarySensorEntityDescription(
key="IsRaining",
name="Is Raining"
translation_key="Is Raining"
)
]


async def async_setup_entry(
hass: HomeAssistant,
entry: ConfigEntry,
Expand Down Expand Up @@ -57,13 +56,9 @@ def __init__(
) -> None:
"""Initialize Davis Vantage sensor."""
super().__init__(coordinator=coordinator)

self.entity_id = (
f"{BINARY_SENSOR_DOMAIN}.{DEFAULT_NAME}_{description.name}".lower()
)
self.entity_description = description
self._attr_name = description.name # type: ignore
self._attr_unique_id = f"{entry_id}-{DEFAULT_NAME} {self.name}"
self.entity_id = f"{BINARY_SENSOR_DOMAIN}.{DEFAULT_NAME} {description.translation_key}".lower()
self._attr_unique_id = f"{entry_id}-{DEFAULT_NAME} {description.translation_key}"
self._attr_device_info = coordinator.device_info

@property
Expand Down
12 changes: 10 additions & 2 deletions custom_components/davis_vantage/icons.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"entity": {
"sensor": {
"davis_vantage_barometric_trend": {
"Barometric Trend": {
"default": "mdi:trending-neutral",
"state": {
"falling_rapidly": "mdi:trending-down",
Expand All @@ -17,7 +17,7 @@
"rising_rapidly": "mdi:trending-up"
}
},
"wind_direction_rose": {
"Wind Direction Rose": {
"default": "mdi:compass-outline",
"state": {
"n": "mdi:arrow-down-bold-outline",
Expand All @@ -30,6 +30,14 @@
"nw": "mdi:arrow-bottom-right-bold-outline"
}
}
},
"binary_sensor": {
"Is Raining": {
"state": {
"on": "mdi:weather-pouring",
"off": "mdi:weather-partly-cloudy"
}
}
}
}
}
Loading

0 comments on commit 8e92368

Please sign in to comment.