Adjust precipitation unit in tomorrowio (#82982)

Adjust precipitation_unit in tomorrowio
This commit is contained in:
epenet 2022-11-30 16:04:37 +01:00 committed by GitHub
parent 5599ab6e4a
commit a12568440d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,7 @@ from homeassistant.const import (
CONF_API_KEY,
CONF_NAME,
UnitOfLength,
UnitOfPrecipitationDepth,
UnitOfPressure,
UnitOfSpeed,
UnitOfTemperature,
@ -73,7 +74,7 @@ async def async_setup_entry(
class TomorrowioWeatherEntity(TomorrowioEntity, WeatherEntity):
"""Entity that talks to Tomorrow.io v4 API to retrieve weather data."""
_attr_native_precipitation_unit = UnitOfLength.MILLIMETERS
_attr_native_precipitation_unit = UnitOfPrecipitationDepth.MILLIMETERS
_attr_native_pressure_unit = UnitOfPressure.HPA
_attr_native_temperature_unit = UnitOfTemperature.CELSIUS
_attr_native_visibility_unit = UnitOfLength.KILOMETERS