Use new device class in lacrosse view (#83365)
This commit is contained in:
parent
9856a811ae
commit
4f94ad475f
1 changed files with 9 additions and 9 deletions
|
@ -15,10 +15,9 @@ from homeassistant.components.sensor import (
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRECIPITATION_INCHES,
|
UnitOfPrecipitationDepth,
|
||||||
SPEED_KILOMETERS_PER_HOUR,
|
UnitOfSpeed,
|
||||||
TEMP_CELSIUS,
|
UnitOfTemperature,
|
||||||
TEMP_FAHRENHEIT,
|
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
@ -57,7 +56,7 @@ SENSOR_DESCRIPTIONS = {
|
||||||
name="Temperature",
|
name="Temperature",
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
value_fn=get_value,
|
value_fn=get_value,
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||||
),
|
),
|
||||||
"Humidity": LaCrosseSensorEntityDescription(
|
"Humidity": LaCrosseSensorEntityDescription(
|
||||||
key="Humidity",
|
key="Humidity",
|
||||||
|
@ -73,22 +72,23 @@ SENSOR_DESCRIPTIONS = {
|
||||||
name="Heat index",
|
name="Heat index",
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
value_fn=get_value,
|
value_fn=get_value,
|
||||||
native_unit_of_measurement=TEMP_FAHRENHEIT,
|
native_unit_of_measurement=UnitOfTemperature.FAHRENHEIT,
|
||||||
),
|
),
|
||||||
"WindSpeed": LaCrosseSensorEntityDescription(
|
"WindSpeed": LaCrosseSensorEntityDescription(
|
||||||
key="WindSpeed",
|
key="WindSpeed",
|
||||||
name="Wind speed",
|
name="Wind speed",
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
value_fn=get_value,
|
value_fn=get_value,
|
||||||
native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR,
|
native_unit_of_measurement=UnitOfSpeed.KILOMETERS_PER_HOUR,
|
||||||
device_class=SensorDeviceClass.SPEED,
|
device_class=SensorDeviceClass.WIND_SPEED,
|
||||||
),
|
),
|
||||||
"Rain": LaCrosseSensorEntityDescription(
|
"Rain": LaCrosseSensorEntityDescription(
|
||||||
key="Rain",
|
key="Rain",
|
||||||
name="Rain",
|
name="Rain",
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
value_fn=get_value,
|
value_fn=get_value,
|
||||||
native_unit_of_measurement=PRECIPITATION_INCHES,
|
native_unit_of_measurement=UnitOfPrecipitationDepth.INCHES,
|
||||||
|
device_class=SensorDeviceClass.PRECIPITATION,
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue