Skip to content

Commit 5bec3ad

Browse files
authored
Merge pull request #24 from ayn/fix/temp-unit
2 parents 48a4c2c + 8bbbe3c commit 5bec3ad

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

custom_components/opencwb/weather.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
from homeassistant.core import HomeAssistant, callback
33
from homeassistant.config_entries import ConfigEntry
44
from homeassistant.components.weather import Forecast, WeatherEntityFeature, SingleCoordinatorWeatherEntity
5-
from homeassistant.const import UnitOfPressure, UnitOfTemperature
5+
from homeassistant.const import UnitOfLength, UnitOfPressure, UnitOfSpeed, UnitOfTemperature
66
from homeassistant.util.unit_conversion import PressureConverter
77
from homeassistant.helpers.device_registry import DeviceEntryType
88
from homeassistant.helpers.entity import DeviceInfo
99
from homeassistant.helpers.entity_platform import AddEntitiesCallback
10-
from homeassistant.const import (
11-
UnitOfSpeed
12-
)
1310

1411
from .const import (
1512
ATTR_API_CLOUDS,
@@ -56,6 +53,9 @@ async def async_setup_entry(
5653
class OpenCWBWeather(SingleCoordinatorWeatherEntity[WeatherUpdateCoordinator]):
5754
"""Implementation of an OpenCWB sensor."""
5855
_attr_attribution = ATTRIBUTION
56+
_attr_native_temperature_unit = UnitOfTemperature.CELSIUS
57+
_attr_native_pressure_unit = UnitOfPressure.HPA
58+
_attr_native_precipitation_unit = UnitOfLength.MILLIMETERS
5959
_attr_native_wind_speed_unit = UnitOfSpeed.METERS_PER_SECOND
6060

6161
def __init__(

0 commit comments

Comments
 (0)