Omit unit of measurement and device class equal to None (#81880)

Omit unit of measurement and dev class none
This commit is contained in:
Ernst Klamer 2022-11-10 09:40:22 +01:00 committed by GitHub
parent 3089ca06c5
commit 0bd04068de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -177,13 +177,11 @@ SENSOR_DESCRIPTIONS = {
# Used for count sensor
(BTHomeSensorDeviceClass.COUNT, None): SensorEntityDescription(
key=f"{BTHomeSensorDeviceClass.COUNT}",
device_class=None,
state_class=SensorStateClass.MEASUREMENT,
),
# Used for rotation sensor
(BTHomeSensorDeviceClass.ROTATION, Units.DEGREE): SensorEntityDescription(
key=f"{BTHomeSensorDeviceClass.ROTATION}_{Units.DEGREE}",
device_class=None,
native_unit_of_measurement=DEGREE,
state_class=SensorStateClass.MEASUREMENT,
),
@ -234,8 +232,6 @@ SENSOR_DESCRIPTIONS = {
# Used for UV index sensor
(BTHomeSensorDeviceClass.UV_INDEX, None,): SensorEntityDescription(
key=f"{BTHomeSensorDeviceClass.UV_INDEX}",
device_class=None,
native_unit_of_measurement=None,
state_class=SensorStateClass.MEASUREMENT,
),
}