Add rules for converting speeds (#80943)

* Add rules for converting speeds

* Update metoffice wind speed sensors to prefer mph

* Don't convert speeds measured in knots
This commit is contained in:
Erik Montnemery 2022-10-25 14:53:59 +02:00 committed by GitHub
parent 93d4d02aac
commit b07e1281da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 0 deletions

View file

@ -83,6 +83,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
key="wind_speed",
name="Wind speed",
native_unit_of_measurement=SPEED_MILES_PER_HOUR,
suggested_unit_of_measurement=SPEED_MILES_PER_HOUR,
device_class=SensorDeviceClass.SPEED,
icon="mdi:weather-windy",
entity_registry_enabled_default=True,
@ -98,6 +99,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
key="wind_gust",
name="Wind gust",
native_unit_of_measurement=SPEED_MILES_PER_HOUR,
suggested_unit_of_measurement=SPEED_MILES_PER_HOUR,
device_class=SensorDeviceClass.SPEED,
icon="mdi:weather-windy",
entity_registry_enabled_default=False,