Use SoundPressure unit and device class in integrations (#83585)

* Use SoundPressure unit and device class in integrations

* Adjust tests
This commit is contained in:
epenet 2022-12-09 07:56:09 +01:00 committed by GitHub
parent 558dceac42
commit 061cef1a5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 9 deletions

View file

@ -31,9 +31,9 @@ from homeassistant.const import (
POWER_WATT,
PRESSURE_HPA,
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
SOUND_PRESSURE_DB,
TEMP_CELSIUS,
Platform,
UnitOfSoundPressure,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity import EntityCategory
@ -330,7 +330,8 @@ SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
key=CharacteristicsTypes.VENDOR_NETATMO_NOISE,
name="Noise",
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=SOUND_PRESSURE_DB,
native_unit_of_measurement=UnitOfSoundPressure.DECIBEL,
device_class=SensorDeviceClass.SOUND_PRESSURE,
),
}