Use Enums in zamg (#61976)
This commit is contained in:
parent
b22a9e4d0a
commit
d68946f568
1 changed files with 7 additions and 4 deletions
|
@ -14,7 +14,11 @@ from aiohttp.hdrs import USER_AGENT
|
||||||
import requests
|
import requests
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
|
from homeassistant.components.sensor import (
|
||||||
|
SensorDeviceClass,
|
||||||
|
SensorEntity,
|
||||||
|
SensorEntityDescription,
|
||||||
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
AREA_SQUARE_METERS,
|
AREA_SQUARE_METERS,
|
||||||
ATTR_ATTRIBUTION,
|
ATTR_ATTRIBUTION,
|
||||||
|
@ -23,7 +27,6 @@ from homeassistant.const import (
|
||||||
CONF_MONITORED_CONDITIONS,
|
CONF_MONITORED_CONDITIONS,
|
||||||
CONF_NAME,
|
CONF_NAME,
|
||||||
DEGREE,
|
DEGREE,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
|
||||||
LENGTH_METERS,
|
LENGTH_METERS,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_HPA,
|
PRESSURE_HPA,
|
||||||
|
@ -124,7 +127,7 @@ SENSOR_TYPES: tuple[ZamgSensorEntityDescription, ...] = (
|
||||||
key="temperature",
|
key="temperature",
|
||||||
name="Temperature",
|
name="Temperature",
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=TEMP_CELSIUS,
|
||||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
col_heading=f"T {TEMP_CELSIUS}",
|
col_heading=f"T {TEMP_CELSIUS}",
|
||||||
dtype=float,
|
dtype=float,
|
||||||
),
|
),
|
||||||
|
@ -139,7 +142,7 @@ SENSOR_TYPES: tuple[ZamgSensorEntityDescription, ...] = (
|
||||||
key="dewpoint",
|
key="dewpoint",
|
||||||
name="Dew Point",
|
name="Dew Point",
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=TEMP_CELSIUS,
|
||||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
col_heading=f"TP {TEMP_CELSIUS}",
|
col_heading=f"TP {TEMP_CELSIUS}",
|
||||||
dtype=float,
|
dtype=float,
|
||||||
),
|
),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue