mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 10:47:10 +00:00
Use SoundPressure unit and device class in point (#83580)
This commit is contained in:
parent
5d71afef85
commit
0edcb26844
@ -11,7 +11,7 @@ from homeassistant.components.sensor import (
|
|||||||
SensorEntityDescription,
|
SensorEntityDescription,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import PERCENTAGE, SOUND_PRESSURE_WEIGHTED_DBA, TEMP_CELSIUS
|
from homeassistant.const import PERCENTAGE, UnitOfSoundPressure, UnitOfTemperature
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
@ -42,7 +42,7 @@ SENSOR_TYPES: tuple[MinutPointSensorEntityDescription, ...] = (
|
|||||||
key="temperature",
|
key="temperature",
|
||||||
precision=1,
|
precision=1,
|
||||||
device_class=SensorDeviceClass.TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||||
),
|
),
|
||||||
MinutPointSensorEntityDescription(
|
MinutPointSensorEntityDescription(
|
||||||
key="humidity",
|
key="humidity",
|
||||||
@ -53,8 +53,8 @@ SENSOR_TYPES: tuple[MinutPointSensorEntityDescription, ...] = (
|
|||||||
MinutPointSensorEntityDescription(
|
MinutPointSensorEntityDescription(
|
||||||
key="sound",
|
key="sound",
|
||||||
precision=1,
|
precision=1,
|
||||||
icon="mdi:ear-hearing",
|
device_class=SensorDeviceClass.SOUND_PRESSURE,
|
||||||
native_unit_of_measurement=SOUND_PRESSURE_WEIGHTED_DBA,
|
native_unit_of_measurement=UnitOfSoundPressure.WEIGHTED_DECIBEL_A,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user