mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 15:47:12 +00:00
Add icon translations to Trafikverket Train (#112322)
* Add icon translations to Trafikverket Train * Add icon translations to Trafikverket Train
This commit is contained in:
parent
bd3add2cad
commit
6e99ca0d8a
39
homeassistant/components/trafikverket_train/icons.json
Normal file
39
homeassistant/components/trafikverket_train/icons.json
Normal file
@ -0,0 +1,39 @@
|
||||
{
|
||||
"entity": {
|
||||
"sensor": {
|
||||
"departure_time": {
|
||||
"default": "mdi:clock"
|
||||
},
|
||||
"departure_state": {
|
||||
"default": "mdi:clock"
|
||||
},
|
||||
"cancelled": {
|
||||
"default": "mdi:alert"
|
||||
},
|
||||
"delayed_time": {
|
||||
"default": "mdi:clock"
|
||||
},
|
||||
"planned_time": {
|
||||
"default": "mdi:clock"
|
||||
},
|
||||
"estimated_time": {
|
||||
"default": "mdi:clock"
|
||||
},
|
||||
"actual_time": {
|
||||
"default": "mdi:clock"
|
||||
},
|
||||
"other_info": {
|
||||
"default": "mdi:information-variant"
|
||||
},
|
||||
"deviation": {
|
||||
"default": "mdi:alert"
|
||||
},
|
||||
"departure_time_next": {
|
||||
"default": "mdi:clock"
|
||||
},
|
||||
"departure_time_next_next": {
|
||||
"default": "mdi:clock"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -43,14 +43,12 @@ SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="departure_time",
|
||||
translation_key="departure_time",
|
||||
icon="mdi:clock",
|
||||
device_class=SensorDeviceClass.TIMESTAMP,
|
||||
value_fn=lambda data: data.departure_time,
|
||||
),
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="departure_state",
|
||||
translation_key="departure_state",
|
||||
icon="mdi:clock",
|
||||
value_fn=lambda data: data.departure_state,
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
options=["on_time", "delayed", "canceled"],
|
||||
@ -58,13 +56,11 @@ SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="cancelled",
|
||||
translation_key="cancelled",
|
||||
icon="mdi:alert",
|
||||
value_fn=lambda data: data.cancelled,
|
||||
),
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="delayed_time",
|
||||
translation_key="delayed_time",
|
||||
icon="mdi:clock",
|
||||
device_class=SensorDeviceClass.DURATION,
|
||||
native_unit_of_measurement=UnitOfTime.SECONDS,
|
||||
value_fn=lambda data: data.delayed_time,
|
||||
@ -72,7 +68,6 @@ SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="planned_time",
|
||||
translation_key="planned_time",
|
||||
icon="mdi:clock",
|
||||
device_class=SensorDeviceClass.TIMESTAMP,
|
||||
value_fn=lambda data: data.planned_time,
|
||||
entity_registry_enabled_default=False,
|
||||
@ -80,7 +75,6 @@ SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="estimated_time",
|
||||
translation_key="estimated_time",
|
||||
icon="mdi:clock",
|
||||
device_class=SensorDeviceClass.TIMESTAMP,
|
||||
value_fn=lambda data: data.estimated_time,
|
||||
entity_registry_enabled_default=False,
|
||||
@ -88,7 +82,6 @@ SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="actual_time",
|
||||
translation_key="actual_time",
|
||||
icon="mdi:clock",
|
||||
device_class=SensorDeviceClass.TIMESTAMP,
|
||||
value_fn=lambda data: data.actual_time,
|
||||
entity_registry_enabled_default=False,
|
||||
@ -96,26 +89,22 @@ SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="other_info",
|
||||
translation_key="other_info",
|
||||
icon="mdi:information-variant",
|
||||
value_fn=lambda data: data.other_info,
|
||||
),
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="deviation",
|
||||
translation_key="deviation",
|
||||
icon="mdi:alert",
|
||||
value_fn=lambda data: data.deviation,
|
||||
),
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="departure_time_next",
|
||||
translation_key="departure_time_next",
|
||||
icon="mdi:clock",
|
||||
device_class=SensorDeviceClass.TIMESTAMP,
|
||||
value_fn=lambda data: data.departure_time_next,
|
||||
),
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="departure_time_next_next",
|
||||
translation_key="departure_time_next_next",
|
||||
icon="mdi:clock",
|
||||
device_class=SensorDeviceClass.TIMESTAMP,
|
||||
value_fn=lambda data: data.departure_time_next_next,
|
||||
),
|
||||
|
@ -5,7 +5,6 @@
|
||||
'attribution': 'Data provided by Trafikverket',
|
||||
'device_class': 'timestamp',
|
||||
'friendly_name': 'Stockholm C to Uppsala C Departure time',
|
||||
'icon': 'mdi:clock',
|
||||
'product_filter': 'Regionaltåg',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
@ -21,7 +20,6 @@
|
||||
'attribution': 'Data provided by Trafikverket',
|
||||
'device_class': 'enum',
|
||||
'friendly_name': 'Stockholm C to Uppsala C Departure state',
|
||||
'icon': 'mdi:clock',
|
||||
'options': list([
|
||||
'on_time',
|
||||
'delayed',
|
||||
@ -42,7 +40,6 @@
|
||||
'attribution': 'Data provided by Trafikverket',
|
||||
'device_class': 'timestamp',
|
||||
'friendly_name': 'Stockholm C to Uppsala C Departure time next',
|
||||
'icon': 'mdi:clock',
|
||||
'product_filter': 'Regionaltåg',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
@ -58,7 +55,6 @@
|
||||
'attribution': 'Data provided by Trafikverket',
|
||||
'device_class': 'timestamp',
|
||||
'friendly_name': 'Stockholm C to Uppsala C Departure time next after',
|
||||
'icon': 'mdi:clock',
|
||||
'product_filter': 'Regionaltåg',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
@ -74,7 +70,6 @@
|
||||
'attribution': 'Data provided by Trafikverket',
|
||||
'device_class': 'timestamp',
|
||||
'friendly_name': 'Stockholm C to Uppsala C Actual time',
|
||||
'icon': 'mdi:clock',
|
||||
'product_filter': 'Regionaltåg',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
@ -89,7 +84,6 @@
|
||||
'attributes': ReadOnlyDict({
|
||||
'attribution': 'Data provided by Trafikverket',
|
||||
'friendly_name': 'Stockholm C to Uppsala C Other information',
|
||||
'icon': 'mdi:information-variant',
|
||||
'product_filter': 'Regionaltåg',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
@ -105,7 +99,6 @@
|
||||
'attribution': 'Data provided by Trafikverket',
|
||||
'device_class': 'timestamp',
|
||||
'friendly_name': 'Stockholm C to Uppsala C Departure time next',
|
||||
'icon': 'mdi:clock',
|
||||
'product_filter': 'Regionaltåg',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
@ -121,7 +114,6 @@
|
||||
'attribution': 'Data provided by Trafikverket',
|
||||
'device_class': 'timestamp',
|
||||
'friendly_name': 'Stockholm C to Uppsala C Departure time next after',
|
||||
'icon': 'mdi:clock',
|
||||
'product_filter': 'Regionaltåg',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
@ -137,7 +129,6 @@
|
||||
'attribution': 'Data provided by Trafikverket',
|
||||
'device_class': 'timestamp',
|
||||
'friendly_name': 'Stockholm C to Uppsala C Departure time',
|
||||
'icon': 'mdi:clock',
|
||||
'product_filter': 'Regionaltåg',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
@ -153,7 +144,6 @@
|
||||
'attribution': 'Data provided by Trafikverket',
|
||||
'device_class': 'enum',
|
||||
'friendly_name': 'Stockholm C to Uppsala C Departure state',
|
||||
'icon': 'mdi:clock',
|
||||
'options': list([
|
||||
'on_time',
|
||||
'delayed',
|
||||
@ -174,7 +164,6 @@
|
||||
'attribution': 'Data provided by Trafikverket',
|
||||
'device_class': 'timestamp',
|
||||
'friendly_name': 'Stockholm C to Uppsala C Actual time',
|
||||
'icon': 'mdi:clock',
|
||||
'product_filter': 'Regionaltåg',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
@ -189,7 +178,6 @@
|
||||
'attributes': ReadOnlyDict({
|
||||
'attribution': 'Data provided by Trafikverket',
|
||||
'friendly_name': 'Stockholm C to Uppsala C Other information',
|
||||
'icon': 'mdi:information-variant',
|
||||
'product_filter': 'Regionaltåg',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
@ -205,7 +193,6 @@
|
||||
'attribution': 'Data provided by Trafikverket',
|
||||
'device_class': 'timestamp',
|
||||
'friendly_name': 'Stockholm C to Uppsala C Departure time',
|
||||
'icon': 'mdi:clock',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.stockholm_c_to_uppsala_c_departure_time_2',
|
||||
|
Loading…
x
Reference in New Issue
Block a user