Use enums in rpi_power (#62046)

This commit is contained in:
Robert Hillis 2021-12-16 10:09:19 -05:00 committed by GitHub
parent 12ae684c96
commit 1fb69fb69a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,7 @@ import logging
from rpi_bad_power import UnderVoltage, new_under_voltage
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_PROBLEM,
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
@ -34,7 +34,7 @@ async def async_setup_entry(
class RaspberryChargerBinarySensor(BinarySensorEntity):
"""Binary sensor representing the rpi power status."""
_attr_device_class = DEVICE_CLASS_PROBLEM
_attr_device_class = BinarySensorDeviceClass.PROBLEM
_attr_icon = "mdi:raspberry-pi"
_attr_name = "RPi Power status"
_attr_unique_id = "rpi_power" # only one sensor possible