mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27: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,
|
||||
)
|
||||
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.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
@ -42,7 +42,7 @@ SENSOR_TYPES: tuple[MinutPointSensorEntityDescription, ...] = (
|
||||
key="temperature",
|
||||
precision=1,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||
),
|
||||
MinutPointSensorEntityDescription(
|
||||
key="humidity",
|
||||
@ -53,8 +53,8 @@ SENSOR_TYPES: tuple[MinutPointSensorEntityDescription, ...] = (
|
||||
MinutPointSensorEntityDescription(
|
||||
key="sound",
|
||||
precision=1,
|
||||
icon="mdi:ear-hearing",
|
||||
native_unit_of_measurement=SOUND_PRESSURE_WEIGHTED_DBA,
|
||||
device_class=SensorDeviceClass.SOUND_PRESSURE,
|
||||
native_unit_of_measurement=UnitOfSoundPressure.WEIGHTED_DECIBEL_A,
|
||||
),
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user