Add entity translations to trafikverket weatherstation (#96251)
parent
cf999d9ba4
commit
b8369a5831
|
@ -87,32 +87,33 @@ class TrafikverketSensorEntityDescription(
|
|||
SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="air_temp",
|
||||
translation_key="air_temperature",
|
||||
api_key="air_temp",
|
||||
name="Air temperature",
|
||||
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="road_temp",
|
||||
translation_key="road_temperature",
|
||||
api_key="road_temp",
|
||||
name="Road temperature",
|
||||
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="precipitation",
|
||||
translation_key="precipitation",
|
||||
api_key="precipitationtype_translated",
|
||||
name="Precipitation type",
|
||||
icon="mdi:weather-snowy-rainy",
|
||||
entity_registry_enabled_default=False,
|
||||
translation_key="precipitation",
|
||||
options=PRECIPITATION_TYPE,
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
),
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="wind_direction",
|
||||
translation_key="wind_direction",
|
||||
api_key="winddirection",
|
||||
name="Wind direction",
|
||||
native_unit_of_measurement=DEGREE,
|
||||
|
@ -121,25 +122,24 @@ SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
|
|||
),
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="wind_direction_text",
|
||||
translation_key="wind_direction_text",
|
||||
api_key="winddirectiontext_translated",
|
||||
name="Wind direction text",
|
||||
icon="mdi:flag-triangle",
|
||||
translation_key="wind_direction_text",
|
||||
options=WIND_DIRECTIONS,
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
),
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="wind_speed",
|
||||
api_key="windforce",
|
||||
name="Wind speed",
|
||||
native_unit_of_measurement=UnitOfSpeed.METERS_PER_SECOND,
|
||||
device_class=SensorDeviceClass.WIND_SPEED,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="wind_speed_max",
|
||||
translation_key="wind_speed_max",
|
||||
api_key="windforcemax",
|
||||
name="Wind speed max",
|
||||
native_unit_of_measurement=UnitOfSpeed.METERS_PER_SECOND,
|
||||
device_class=SensorDeviceClass.WIND_SPEED,
|
||||
icon="mdi:weather-windy-variant",
|
||||
|
@ -149,9 +149,7 @@ SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
|
|||
TrafikverketSensorEntityDescription(
|
||||
key="humidity",
|
||||
api_key="humidity",
|
||||
name="Humidity",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:water-percent",
|
||||
device_class=SensorDeviceClass.HUMIDITY,
|
||||
entity_registry_enabled_default=False,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
|
@ -159,25 +157,23 @@ SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = (
|
|||
TrafikverketSensorEntityDescription(
|
||||
key="precipitation_amount",
|
||||
api_key="precipitation_amount",
|
||||
name="Precipitation amount",
|
||||
native_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR,
|
||||
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="precipitation_amountname",
|
||||
translation_key="precipitation_amountname",
|
||||
api_key="precipitation_amountname_translated",
|
||||
name="Precipitation name",
|
||||
icon="mdi:weather-pouring",
|
||||
entity_registry_enabled_default=False,
|
||||
translation_key="precipitation_amountname",
|
||||
options=PRECIPITATION_AMOUNTNAME,
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
),
|
||||
TrafikverketSensorEntityDescription(
|
||||
key="measure_time",
|
||||
translation_key="measure_time",
|
||||
api_key="measure_time",
|
||||
name="Measure Time",
|
||||
icon="mdi:clock",
|
||||
entity_registry_enabled_default=False,
|
||||
device_class=SensorDeviceClass.TIMESTAMP,
|
||||
|
|
|
@ -20,7 +20,29 @@
|
|||
},
|
||||
"entity": {
|
||||
"sensor": {
|
||||
"air_temperature": {
|
||||
"name": "Air temperature"
|
||||
},
|
||||
"road_temperature": {
|
||||
"name": "Road temperature"
|
||||
},
|
||||
"precipitation": {
|
||||
"name": "Precipitation type",
|
||||
"state": {
|
||||
"drizzle": "Drizzle",
|
||||
"hail": "Hail",
|
||||
"none": "None",
|
||||
"rain": "Rain",
|
||||
"snow": "Snow",
|
||||
"rain_snow_mixed": "Rain and snow mixed",
|
||||
"freezing_rain": "Freezing rain"
|
||||
}
|
||||
},
|
||||
"wind_direction": {
|
||||
"name": "Wind direction"
|
||||
},
|
||||
"wind_direction_text": {
|
||||
"name": "Wind direction text",
|
||||
"state": {
|
||||
"east": "East",
|
||||
"north_east": "North east",
|
||||
|
@ -36,7 +58,11 @@
|
|||
"west": "West"
|
||||
}
|
||||
},
|
||||
"wind_speed_max": {
|
||||
"name": "Wind speed max"
|
||||
},
|
||||
"precipitation_amountname": {
|
||||
"name": "Precipitation name",
|
||||
"state": {
|
||||
"error": "Error",
|
||||
"mild_rain": "Mild rain",
|
||||
|
@ -53,16 +79,8 @@
|
|||
"unknown": "Unknown"
|
||||
}
|
||||
},
|
||||
"precipitation": {
|
||||
"state": {
|
||||
"drizzle": "Drizzle",
|
||||
"hail": "Hail",
|
||||
"none": "None",
|
||||
"rain": "Rain",
|
||||
"snow": "Snow",
|
||||
"rain_snow_mixed": "Rain and snow mixed",
|
||||
"freezing_rain": "Freezing rain"
|
||||
}
|
||||
"measure_time": {
|
||||
"name": "Measure time"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue