mirror of
https://github.com/home-assistant/core.git
synced 2025-08-12 00:55:26 +02:00
Use enums in rpi_power (#62046)
This commit is contained in:
@@ -8,7 +8,7 @@ import logging
|
|||||||
from rpi_bad_power import UnderVoltage, new_under_voltage
|
from rpi_bad_power import UnderVoltage, new_under_voltage
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
DEVICE_CLASS_PROBLEM,
|
BinarySensorDeviceClass,
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
@@ -34,7 +34,7 @@ async def async_setup_entry(
|
|||||||
class RaspberryChargerBinarySensor(BinarySensorEntity):
|
class RaspberryChargerBinarySensor(BinarySensorEntity):
|
||||||
"""Binary sensor representing the rpi power status."""
|
"""Binary sensor representing the rpi power status."""
|
||||||
|
|
||||||
_attr_device_class = DEVICE_CLASS_PROBLEM
|
_attr_device_class = BinarySensorDeviceClass.PROBLEM
|
||||||
_attr_icon = "mdi:raspberry-pi"
|
_attr_icon = "mdi:raspberry-pi"
|
||||||
_attr_name = "RPi Power status"
|
_attr_name = "RPi Power status"
|
||||||
_attr_unique_id = "rpi_power" # only one sensor possible
|
_attr_unique_id = "rpi_power" # only one sensor possible
|
||||||
|
Reference in New Issue
Block a user