mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Use new SensorDeviceClass enum in freebox (#61444)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
731c70a0e7
commit
eb27da3cd4
@ -4,13 +4,13 @@ from __future__ import annotations
|
|||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
|
from homeassistant.components.sensor import (
|
||||||
from homeassistant.config_entries import ConfigEntry
|
SensorDeviceClass,
|
||||||
from homeassistant.const import (
|
SensorEntity,
|
||||||
DATA_RATE_KILOBYTES_PER_SECOND,
|
SensorEntityDescription,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
|
||||||
TEMP_CELSIUS,
|
|
||||||
)
|
)
|
||||||
|
from homeassistant.config_entries import ConfigEntry
|
||||||
|
from homeassistant.const import DATA_RATE_KILOBYTES_PER_SECOND, TEMP_CELSIUS
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
@ -42,7 +42,7 @@ async def async_setup_entry(
|
|||||||
key=sensor_name,
|
key=sensor_name,
|
||||||
name=f"Freebox {sensor_name}",
|
name=f"Freebox {sensor_name}",
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=TEMP_CELSIUS,
|
||||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
for sensor_name in router.sensors_temperature
|
for sensor_name in router.sensors_temperature
|
||||||
|
Loading…
x
Reference in New Issue
Block a user