Use new SensorDeviceClass in arwn (#61275)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
84141ff3dd
commit
25db4a4f1f
1 changed files with 2 additions and 3 deletions
|
@ -3,10 +3,9 @@ import json
|
|||
import logging
|
||||
|
||||
from homeassistant.components import mqtt
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
|
||||
from homeassistant.const import (
|
||||
DEGREE,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
PRECIPITATION_INCHES,
|
||||
TEMP_CELSIUS,
|
||||
TEMP_FAHRENHEIT,
|
||||
|
@ -37,7 +36,7 @@ def discover_sensors(topic, payload):
|
|||
else:
|
||||
unit = TEMP_CELSIUS
|
||||
return ArwnSensor(
|
||||
topic, name, "temp", unit, device_class=DEVICE_CLASS_TEMPERATURE
|
||||
topic, name, "temp", unit, device_class=SensorDeviceClass.TEMPERATURE
|
||||
)
|
||||
if domain == "moisture":
|
||||
name = f"{parts[2]} Moisture"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue