diff --git a/homeassistant/components/ambient_station/sensor.py b/homeassistant/components/ambient_station/sensor.py index a04c279915f..65c726bfff3 100644 --- a/homeassistant/components/ambient_station/sensor.py +++ b/homeassistant/components/ambient_station/sensor.py @@ -308,6 +308,7 @@ SENSOR_DESCRIPTIONS = ( name="Max gust", icon="mdi:weather-windy", native_unit_of_measurement=SPEED_MILES_PER_HOUR, + device_class=SensorDeviceClass.SPEED, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( @@ -631,6 +632,7 @@ SENSOR_DESCRIPTIONS = ( name="Wind gust", icon="mdi:weather-windy", native_unit_of_measurement=SPEED_MILES_PER_HOUR, + device_class=SensorDeviceClass.SPEED, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( @@ -638,18 +640,21 @@ SENSOR_DESCRIPTIONS = ( name="Wind avg 10m", icon="mdi:weather-windy", native_unit_of_measurement=SPEED_MILES_PER_HOUR, + device_class=SensorDeviceClass.SPEED, ), SensorEntityDescription( key=TYPE_WINDSPDMPH_AVG2M, name="Wind avg 2m", icon="mdi:weather-windy", native_unit_of_measurement=SPEED_MILES_PER_HOUR, + device_class=SensorDeviceClass.SPEED, ), SensorEntityDescription( key=TYPE_WINDSPEEDMPH, name="Wind speed", icon="mdi:weather-windy", native_unit_of_measurement=SPEED_MILES_PER_HOUR, + device_class=SensorDeviceClass.SPEED, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( diff --git a/homeassistant/components/buienradar/sensor.py b/homeassistant/components/buienradar/sensor.py index 2f3e60b0646..08303120a92 100644 --- a/homeassistant/components/buienradar/sensor.py +++ b/homeassistant/components/buienradar/sensor.py @@ -138,6 +138,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( key="windspeed", name="Wind speed", native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR, + device_class=SensorDeviceClass.SPEED, icon="mdi:weather-windy", state_class=SensorStateClass.MEASUREMENT, ), @@ -175,6 +176,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( key="windgust", name="Wind gust", native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR, + device_class=SensorDeviceClass.SPEED, icon="mdi:weather-windy", ), SensorEntityDescription( @@ -463,30 +465,35 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( key="windspeed_1d", name="Wind speed 1d", native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR, + device_class=SensorDeviceClass.SPEED, icon="mdi:weather-windy", ), SensorEntityDescription( key="windspeed_2d", name="Wind speed 2d", native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR, + device_class=SensorDeviceClass.SPEED, icon="mdi:weather-windy", ), SensorEntityDescription( key="windspeed_3d", name="Wind speed 3d", native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR, + device_class=SensorDeviceClass.SPEED, icon="mdi:weather-windy", ), SensorEntityDescription( key="windspeed_4d", name="Wind speed 4d", native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR, + device_class=SensorDeviceClass.SPEED, icon="mdi:weather-windy", ), SensorEntityDescription( key="windspeed_5d", name="Wind speed 5d", native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR, + device_class=SensorDeviceClass.SPEED, icon="mdi:weather-windy", ), SensorEntityDescription( diff --git a/homeassistant/components/environment_canada/sensor.py b/homeassistant/components/environment_canada/sensor.py index 08da60fe01f..5f22b251493 100644 --- a/homeassistant/components/environment_canada/sensor.py +++ b/homeassistant/components/environment_canada/sensor.py @@ -198,6 +198,7 @@ SENSOR_TYPES: tuple[ECSensorEntityDescription, ...] = ( key="wind_gust", name="Wind gust", native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR, + device_class=SensorDeviceClass.SPEED, state_class=SensorStateClass.MEASUREMENT, value_fn=lambda data: data.conditions.get("wind_gust", {}).get("value"), ), @@ -205,6 +206,7 @@ SENSOR_TYPES: tuple[ECSensorEntityDescription, ...] = ( key="wind_speed", name="Wind speed", native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR, + device_class=SensorDeviceClass.SPEED, state_class=SensorStateClass.MEASUREMENT, value_fn=lambda data: data.conditions.get("wind_speed", {}).get("value"), ), diff --git a/homeassistant/components/homematic/sensor.py b/homeassistant/components/homematic/sensor.py index 456a10b7630..c7a78c7bbcf 100644 --- a/homeassistant/components/homematic/sensor.py +++ b/homeassistant/components/homematic/sensor.py @@ -170,6 +170,7 @@ SENSOR_DESCRIPTIONS: dict[str, SensorEntityDescription] = { "WIND_SPEED": SensorEntityDescription( key="WIND_SPEED", native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR, + device_class=SensorDeviceClass.SPEED, icon="mdi:weather-windy", ), "WIND_DIRECTION": SensorEntityDescription( diff --git a/homeassistant/components/homematicip_cloud/sensor.py b/homeassistant/components/homematicip_cloud/sensor.py index 57a8b7bd714..bb9dd8021ed 100644 --- a/homeassistant/components/homematicip_cloud/sensor.py +++ b/homeassistant/components/homematicip_cloud/sensor.py @@ -344,6 +344,8 @@ class HomematicipEnergySensor(HomematicipGenericEntity, SensorEntity): class HomematicipWindspeedSensor(HomematicipGenericEntity, SensorEntity): """Representation of the HomematicIP wind speed sensor.""" + _attr_device_class = SensorDeviceClass.SPEED + def __init__(self, hap: HomematicipHAP, device) -> None: """Initialize the windspeed sensor.""" super().__init__(hap, device, post="Windspeed") diff --git a/homeassistant/components/lacrosse_view/sensor.py b/homeassistant/components/lacrosse_view/sensor.py index 0f60ef4ca10..1ff3e78812f 100644 --- a/homeassistant/components/lacrosse_view/sensor.py +++ b/homeassistant/components/lacrosse_view/sensor.py @@ -81,6 +81,7 @@ SENSOR_DESCRIPTIONS = { state_class=SensorStateClass.MEASUREMENT, value_fn=get_value, native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR, + device_class=SensorDeviceClass.SPEED, ), "Rain": LaCrosseSensorEntityDescription( key="Rain", diff --git a/homeassistant/components/netatmo/sensor.py b/homeassistant/components/netatmo/sensor.py index ff555ecd472..65ac610ef5d 100644 --- a/homeassistant/components/netatmo/sensor.py +++ b/homeassistant/components/netatmo/sensor.py @@ -200,6 +200,7 @@ SENSOR_TYPES: tuple[NetatmoSensorEntityDescription, ...] = ( netatmo_name="wind_strength", entity_registry_enabled_default=True, native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR, + device_class=SensorDeviceClass.SPEED, icon="mdi:weather-windy", state_class=SensorStateClass.MEASUREMENT, ), @@ -225,6 +226,7 @@ SENSOR_TYPES: tuple[NetatmoSensorEntityDescription, ...] = ( netatmo_name="gust_strength", entity_registry_enabled_default=False, native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR, + device_class=SensorDeviceClass.SPEED, icon="mdi:weather-windy", state_class=SensorStateClass.MEASUREMENT, ), diff --git a/homeassistant/components/tellduslive/sensor.py b/homeassistant/components/tellduslive/sensor.py index 8d02763d428..e2995620fb1 100644 --- a/homeassistant/components/tellduslive/sensor.py +++ b/homeassistant/components/tellduslive/sensor.py @@ -76,12 +76,14 @@ SENSOR_TYPES: dict[str, SensorEntityDescription] = { key=SENSOR_TYPE_WINDAVERAGE, name="Wind average", native_unit_of_measurement=SPEED_METERS_PER_SECOND, + device_class=SensorDeviceClass.SPEED, state_class=SensorStateClass.MEASUREMENT, ), SENSOR_TYPE_WINDGUST: SensorEntityDescription( key=SENSOR_TYPE_WINDGUST, name="Wind gust", native_unit_of_measurement=SPEED_METERS_PER_SECOND, + device_class=SensorDeviceClass.SPEED, state_class=SensorStateClass.MEASUREMENT, ), SENSOR_TYPE_UV: SensorEntityDescription( diff --git a/homeassistant/components/trafikverket_weatherstation/sensor.py b/homeassistant/components/trafikverket_weatherstation/sensor.py index 68c47e9320c..4053ce7cbc4 100644 --- a/homeassistant/components/trafikverket_weatherstation/sensor.py +++ b/homeassistant/components/trafikverket_weatherstation/sensor.py @@ -89,6 +89,7 @@ SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = ( api_key="windforce", name="Wind speed", native_unit_of_measurement=SPEED_METERS_PER_SECOND, + device_class=SensorDeviceClass.SPEED, icon="mdi:weather-windy", state_class=SensorStateClass.MEASUREMENT, ), @@ -97,6 +98,7 @@ SENSOR_TYPES: tuple[TrafikverketSensorEntityDescription, ...] = ( api_key="windforcemax", name="Wind speed max", native_unit_of_measurement=SPEED_METERS_PER_SECOND, + device_class=SensorDeviceClass.SPEED, icon="mdi:weather-windy-variant", entity_registry_enabled_default=False, state_class=SensorStateClass.MEASUREMENT,