Correct deprecated volt units on yalexs_ble sensor (#83738)

This commit is contained in:
J. Nick Koston 2022-12-10 15:02:21 -10:00 committed by GitHub
parent f19a1147fe
commit a65ce7e6c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,9 +14,9 @@ from homeassistant.components.sensor import (
SensorStateClass,
)
from homeassistant.const import (
ELECTRIC_POTENTIAL_VOLT,
PERCENTAGE,
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
UnitOfElectricPotential,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity import EntityCategory
@ -72,7 +72,7 @@ SENSORS: tuple[YaleXSBLESensorEntityDescription, ...] = (
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.MEASUREMENT,
has_entity_name=True,
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
entity_registry_enabled_default=False,
value_fn=lambda state, info, connection: state.battery.voltage
if state.battery