mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 08:07:45 +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(
|
TrafikverketSensorEntityDescription(
|
||||||
key="departure_time",
|
key="departure_time",
|
||||||
translation_key="departure_time",
|
translation_key="departure_time",
|
||||||
icon="mdi:clock",
|
|
||||||
device_class=SensorDeviceClass.TIMESTAMP,
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
value_fn=lambda data: data.departure_time,
|
value_fn=lambda data: data.departure_time,
|
||||||
),
|
),
|
||||||
TrafikverketSensorEntityDescription(
|
TrafikverketSensorEntityDescription(
|
||||||
key="departure_state",
|
key="departure_state",
|
||||||
translation_key="departure_state",
|
translation_key="departure_state",
|
||||||
icon="mdi:clock",
|
|
||||||
value_fn=lambda data: data.departure_state,
|
value_fn=lambda data: data.departure_state,
|
||||||
device_class=SensorDeviceClass.ENUM,
|
device_class=SensorDeviceClass.ENUM,
|
||||||
options=["on_time", "delayed", "canceled"],
|
options=["on_time", "delayed", "canceled"],
|
||||||
@ -58,13 +56,11 @@ SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
|
|||||||
TrafikverketSensorEntityDescription(
|
TrafikverketSensorEntityDescription(
|
||||||
key="cancelled",
|
key="cancelled",
|
||||||
translation_key="cancelled",
|
translation_key="cancelled",
|
||||||
icon="mdi:alert",
|
|
||||||
value_fn=lambda data: data.cancelled,
|
value_fn=lambda data: data.cancelled,
|
||||||
),
|
),
|
||||||
TrafikverketSensorEntityDescription(
|
TrafikverketSensorEntityDescription(
|
||||||
key="delayed_time",
|
key="delayed_time",
|
||||||
translation_key="delayed_time",
|
translation_key="delayed_time",
|
||||||
icon="mdi:clock",
|
|
||||||
device_class=SensorDeviceClass.DURATION,
|
device_class=SensorDeviceClass.DURATION,
|
||||||
native_unit_of_measurement=UnitOfTime.SECONDS,
|
native_unit_of_measurement=UnitOfTime.SECONDS,
|
||||||
value_fn=lambda data: data.delayed_time,
|
value_fn=lambda data: data.delayed_time,
|
||||||
@ -72,7 +68,6 @@ SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
|
|||||||
TrafikverketSensorEntityDescription(
|
TrafikverketSensorEntityDescription(
|
||||||
key="planned_time",
|
key="planned_time",
|
||||||
translation_key="planned_time",
|
translation_key="planned_time",
|
||||||
icon="mdi:clock",
|
|
||||||
device_class=SensorDeviceClass.TIMESTAMP,
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
value_fn=lambda data: data.planned_time,
|
value_fn=lambda data: data.planned_time,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
@ -80,7 +75,6 @@ SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
|
|||||||
TrafikverketSensorEntityDescription(
|
TrafikverketSensorEntityDescription(
|
||||||
key="estimated_time",
|
key="estimated_time",
|
||||||
translation_key="estimated_time",
|
translation_key="estimated_time",
|
||||||
icon="mdi:clock",
|
|
||||||
device_class=SensorDeviceClass.TIMESTAMP,
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
value_fn=lambda data: data.estimated_time,
|
value_fn=lambda data: data.estimated_time,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
@ -88,7 +82,6 @@ SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
|
|||||||
TrafikverketSensorEntityDescription(
|
TrafikverketSensorEntityDescription(
|
||||||
key="actual_time",
|
key="actual_time",
|
||||||
translation_key="actual_time",
|
translation_key="actual_time",
|
||||||
icon="mdi:clock",
|
|
||||||
device_class=SensorDeviceClass.TIMESTAMP,
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
value_fn=lambda data: data.actual_time,
|
value_fn=lambda data: data.actual_time,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
@ -96,26 +89,22 @@ SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
|
|||||||
TrafikverketSensorEntityDescription(
|
TrafikverketSensorEntityDescription(
|
||||||
key="other_info",
|
key="other_info",
|
||||||
translation_key="other_info",
|
translation_key="other_info",
|
||||||
icon="mdi:information-variant",
|
|
||||||
value_fn=lambda data: data.other_info,
|
value_fn=lambda data: data.other_info,
|
||||||
),
|
),
|
||||||
TrafikverketSensorEntityDescription(
|
TrafikverketSensorEntityDescription(
|
||||||
key="deviation",
|
key="deviation",
|
||||||
translation_key="deviation",
|
translation_key="deviation",
|
||||||
icon="mdi:alert",
|
|
||||||
value_fn=lambda data: data.deviation,
|
value_fn=lambda data: data.deviation,
|
||||||
),
|
),
|
||||||
TrafikverketSensorEntityDescription(
|
TrafikverketSensorEntityDescription(
|
||||||
key="departure_time_next",
|
key="departure_time_next",
|
||||||
translation_key="departure_time_next",
|
translation_key="departure_time_next",
|
||||||
icon="mdi:clock",
|
|
||||||
device_class=SensorDeviceClass.TIMESTAMP,
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
value_fn=lambda data: data.departure_time_next,
|
value_fn=lambda data: data.departure_time_next,
|
||||||
),
|
),
|
||||||
TrafikverketSensorEntityDescription(
|
TrafikverketSensorEntityDescription(
|
||||||
key="departure_time_next_next",
|
key="departure_time_next_next",
|
||||||
translation_key="departure_time_next_next",
|
translation_key="departure_time_next_next",
|
||||||
icon="mdi:clock",
|
|
||||||
device_class=SensorDeviceClass.TIMESTAMP,
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
value_fn=lambda data: data.departure_time_next_next,
|
value_fn=lambda data: data.departure_time_next_next,
|
||||||
),
|
),
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
'attribution': 'Data provided by Trafikverket',
|
'attribution': 'Data provided by Trafikverket',
|
||||||
'device_class': 'timestamp',
|
'device_class': 'timestamp',
|
||||||
'friendly_name': 'Stockholm C to Uppsala C Departure time',
|
'friendly_name': 'Stockholm C to Uppsala C Departure time',
|
||||||
'icon': 'mdi:clock',
|
|
||||||
'product_filter': 'Regionaltåg',
|
'product_filter': 'Regionaltåg',
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
@ -21,7 +20,6 @@
|
|||||||
'attribution': 'Data provided by Trafikverket',
|
'attribution': 'Data provided by Trafikverket',
|
||||||
'device_class': 'enum',
|
'device_class': 'enum',
|
||||||
'friendly_name': 'Stockholm C to Uppsala C Departure state',
|
'friendly_name': 'Stockholm C to Uppsala C Departure state',
|
||||||
'icon': 'mdi:clock',
|
|
||||||
'options': list([
|
'options': list([
|
||||||
'on_time',
|
'on_time',
|
||||||
'delayed',
|
'delayed',
|
||||||
@ -42,7 +40,6 @@
|
|||||||
'attribution': 'Data provided by Trafikverket',
|
'attribution': 'Data provided by Trafikverket',
|
||||||
'device_class': 'timestamp',
|
'device_class': 'timestamp',
|
||||||
'friendly_name': 'Stockholm C to Uppsala C Departure time next',
|
'friendly_name': 'Stockholm C to Uppsala C Departure time next',
|
||||||
'icon': 'mdi:clock',
|
|
||||||
'product_filter': 'Regionaltåg',
|
'product_filter': 'Regionaltåg',
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
@ -58,7 +55,6 @@
|
|||||||
'attribution': 'Data provided by Trafikverket',
|
'attribution': 'Data provided by Trafikverket',
|
||||||
'device_class': 'timestamp',
|
'device_class': 'timestamp',
|
||||||
'friendly_name': 'Stockholm C to Uppsala C Departure time next after',
|
'friendly_name': 'Stockholm C to Uppsala C Departure time next after',
|
||||||
'icon': 'mdi:clock',
|
|
||||||
'product_filter': 'Regionaltåg',
|
'product_filter': 'Regionaltåg',
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
@ -74,7 +70,6 @@
|
|||||||
'attribution': 'Data provided by Trafikverket',
|
'attribution': 'Data provided by Trafikverket',
|
||||||
'device_class': 'timestamp',
|
'device_class': 'timestamp',
|
||||||
'friendly_name': 'Stockholm C to Uppsala C Actual time',
|
'friendly_name': 'Stockholm C to Uppsala C Actual time',
|
||||||
'icon': 'mdi:clock',
|
|
||||||
'product_filter': 'Regionaltåg',
|
'product_filter': 'Regionaltåg',
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
@ -89,7 +84,6 @@
|
|||||||
'attributes': ReadOnlyDict({
|
'attributes': ReadOnlyDict({
|
||||||
'attribution': 'Data provided by Trafikverket',
|
'attribution': 'Data provided by Trafikverket',
|
||||||
'friendly_name': 'Stockholm C to Uppsala C Other information',
|
'friendly_name': 'Stockholm C to Uppsala C Other information',
|
||||||
'icon': 'mdi:information-variant',
|
|
||||||
'product_filter': 'Regionaltåg',
|
'product_filter': 'Regionaltåg',
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
@ -105,7 +99,6 @@
|
|||||||
'attribution': 'Data provided by Trafikverket',
|
'attribution': 'Data provided by Trafikverket',
|
||||||
'device_class': 'timestamp',
|
'device_class': 'timestamp',
|
||||||
'friendly_name': 'Stockholm C to Uppsala C Departure time next',
|
'friendly_name': 'Stockholm C to Uppsala C Departure time next',
|
||||||
'icon': 'mdi:clock',
|
|
||||||
'product_filter': 'Regionaltåg',
|
'product_filter': 'Regionaltåg',
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
@ -121,7 +114,6 @@
|
|||||||
'attribution': 'Data provided by Trafikverket',
|
'attribution': 'Data provided by Trafikverket',
|
||||||
'device_class': 'timestamp',
|
'device_class': 'timestamp',
|
||||||
'friendly_name': 'Stockholm C to Uppsala C Departure time next after',
|
'friendly_name': 'Stockholm C to Uppsala C Departure time next after',
|
||||||
'icon': 'mdi:clock',
|
|
||||||
'product_filter': 'Regionaltåg',
|
'product_filter': 'Regionaltåg',
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
@ -137,7 +129,6 @@
|
|||||||
'attribution': 'Data provided by Trafikverket',
|
'attribution': 'Data provided by Trafikverket',
|
||||||
'device_class': 'timestamp',
|
'device_class': 'timestamp',
|
||||||
'friendly_name': 'Stockholm C to Uppsala C Departure time',
|
'friendly_name': 'Stockholm C to Uppsala C Departure time',
|
||||||
'icon': 'mdi:clock',
|
|
||||||
'product_filter': 'Regionaltåg',
|
'product_filter': 'Regionaltåg',
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
@ -153,7 +144,6 @@
|
|||||||
'attribution': 'Data provided by Trafikverket',
|
'attribution': 'Data provided by Trafikverket',
|
||||||
'device_class': 'enum',
|
'device_class': 'enum',
|
||||||
'friendly_name': 'Stockholm C to Uppsala C Departure state',
|
'friendly_name': 'Stockholm C to Uppsala C Departure state',
|
||||||
'icon': 'mdi:clock',
|
|
||||||
'options': list([
|
'options': list([
|
||||||
'on_time',
|
'on_time',
|
||||||
'delayed',
|
'delayed',
|
||||||
@ -174,7 +164,6 @@
|
|||||||
'attribution': 'Data provided by Trafikverket',
|
'attribution': 'Data provided by Trafikverket',
|
||||||
'device_class': 'timestamp',
|
'device_class': 'timestamp',
|
||||||
'friendly_name': 'Stockholm C to Uppsala C Actual time',
|
'friendly_name': 'Stockholm C to Uppsala C Actual time',
|
||||||
'icon': 'mdi:clock',
|
|
||||||
'product_filter': 'Regionaltåg',
|
'product_filter': 'Regionaltåg',
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
@ -189,7 +178,6 @@
|
|||||||
'attributes': ReadOnlyDict({
|
'attributes': ReadOnlyDict({
|
||||||
'attribution': 'Data provided by Trafikverket',
|
'attribution': 'Data provided by Trafikverket',
|
||||||
'friendly_name': 'Stockholm C to Uppsala C Other information',
|
'friendly_name': 'Stockholm C to Uppsala C Other information',
|
||||||
'icon': 'mdi:information-variant',
|
|
||||||
'product_filter': 'Regionaltåg',
|
'product_filter': 'Regionaltåg',
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
@ -205,7 +193,6 @@
|
|||||||
'attribution': 'Data provided by Trafikverket',
|
'attribution': 'Data provided by Trafikverket',
|
||||||
'device_class': 'timestamp',
|
'device_class': 'timestamp',
|
||||||
'friendly_name': 'Stockholm C to Uppsala C Departure time',
|
'friendly_name': 'Stockholm C to Uppsala C Departure time',
|
||||||
'icon': 'mdi:clock',
|
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
'entity_id': 'sensor.stockholm_c_to_uppsala_c_departure_time_2',
|
'entity_id': 'sensor.stockholm_c_to_uppsala_c_departure_time_2',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user