mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 07:37:34 +00:00
Add entity translations to Ukraine Alarm (#96260)
* Add entity translations to Ukraine Alarm * Add entity translations to Ukraine Alarm
This commit is contained in:
parent
2257e7454a
commit
a7edf0a608
@ -30,36 +30,36 @@ from .const import (
|
||||
BINARY_SENSOR_TYPES: tuple[BinarySensorEntityDescription, ...] = (
|
||||
BinarySensorEntityDescription(
|
||||
key=ALERT_TYPE_UNKNOWN,
|
||||
name="Unknown",
|
||||
translation_key="unknown",
|
||||
device_class=BinarySensorDeviceClass.SAFETY,
|
||||
),
|
||||
BinarySensorEntityDescription(
|
||||
key=ALERT_TYPE_AIR,
|
||||
name="Air",
|
||||
translation_key="air",
|
||||
device_class=BinarySensorDeviceClass.SAFETY,
|
||||
icon="mdi:cloud",
|
||||
),
|
||||
BinarySensorEntityDescription(
|
||||
key=ALERT_TYPE_URBAN_FIGHTS,
|
||||
name="Urban Fights",
|
||||
translation_key="urban_fights",
|
||||
device_class=BinarySensorDeviceClass.SAFETY,
|
||||
icon="mdi:pistol",
|
||||
),
|
||||
BinarySensorEntityDescription(
|
||||
key=ALERT_TYPE_ARTILLERY,
|
||||
name="Artillery",
|
||||
translation_key="artillery",
|
||||
device_class=BinarySensorDeviceClass.SAFETY,
|
||||
icon="mdi:tank",
|
||||
),
|
||||
BinarySensorEntityDescription(
|
||||
key=ALERT_TYPE_CHEMICAL,
|
||||
name="Chemical",
|
||||
translation_key="chemical",
|
||||
device_class=BinarySensorDeviceClass.SAFETY,
|
||||
icon="mdi:chemical-weapon",
|
||||
),
|
||||
BinarySensorEntityDescription(
|
||||
key=ALERT_TYPE_NUCLEAR,
|
||||
name="Nuclear",
|
||||
translation_key="nuclear",
|
||||
device_class=BinarySensorDeviceClass.SAFETY,
|
||||
icon="mdi:nuke",
|
||||
),
|
||||
@ -92,6 +92,7 @@ class UkraineAlarmSensor(
|
||||
"""Class for a Ukraine Alarm binary sensor."""
|
||||
|
||||
_attr_attribution = ATTRIBUTION
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@ -105,7 +106,6 @@ class UkraineAlarmSensor(
|
||||
|
||||
self.entity_description = description
|
||||
|
||||
self._attr_name = f"{name} {description.name}"
|
||||
self._attr_unique_id = f"{unique_id}-{description.key}".lower()
|
||||
self._attr_device_info = DeviceInfo(
|
||||
entry_type=DeviceEntryType.SERVICE,
|
||||
|
@ -28,5 +28,27 @@
|
||||
"description": "If you want to monitor not only state and district, choose its specific community"
|
||||
}
|
||||
}
|
||||
},
|
||||
"entity": {
|
||||
"binary_sensor": {
|
||||
"unknown": {
|
||||
"name": "Unknown"
|
||||
},
|
||||
"air": {
|
||||
"name": "Air"
|
||||
},
|
||||
"urban_fights": {
|
||||
"name": "Urban fights"
|
||||
},
|
||||
"artillery": {
|
||||
"name": "Artillery"
|
||||
},
|
||||
"chemical": {
|
||||
"name": "Chemical"
|
||||
},
|
||||
"nuclear": {
|
||||
"name": "Nuclear"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user