mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Use enums in pi_hole (#62064)
This commit is contained in:
parent
6ba11fe6c7
commit
a16f963605
@ -9,7 +9,7 @@ from typing import Any
|
|||||||
from hole import Hole
|
from hole import Hole
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
DEVICE_CLASS_UPDATE,
|
BinarySensorDeviceClass,
|
||||||
BinarySensorEntityDescription,
|
BinarySensorEntityDescription,
|
||||||
)
|
)
|
||||||
from homeassistant.components.sensor import SensorEntityDescription
|
from homeassistant.components.sensor import SensorEntityDescription
|
||||||
@ -122,7 +122,7 @@ BINARY_SENSOR_TYPES: tuple[PiHoleBinarySensorEntityDescription, ...] = (
|
|||||||
PiHoleBinarySensorEntityDescription(
|
PiHoleBinarySensorEntityDescription(
|
||||||
key="core_update_available",
|
key="core_update_available",
|
||||||
name="Core Update Available",
|
name="Core Update Available",
|
||||||
device_class=DEVICE_CLASS_UPDATE,
|
device_class=BinarySensorDeviceClass.UPDATE,
|
||||||
extra_value=lambda api: {
|
extra_value=lambda api: {
|
||||||
"current_version": api.versions["core_current"],
|
"current_version": api.versions["core_current"],
|
||||||
"latest_version": api.versions["core_latest"],
|
"latest_version": api.versions["core_latest"],
|
||||||
@ -132,7 +132,7 @@ BINARY_SENSOR_TYPES: tuple[PiHoleBinarySensorEntityDescription, ...] = (
|
|||||||
PiHoleBinarySensorEntityDescription(
|
PiHoleBinarySensorEntityDescription(
|
||||||
key="web_update_available",
|
key="web_update_available",
|
||||||
name="Web Update Available",
|
name="Web Update Available",
|
||||||
device_class=DEVICE_CLASS_UPDATE,
|
device_class=BinarySensorDeviceClass.UPDATE,
|
||||||
extra_value=lambda api: {
|
extra_value=lambda api: {
|
||||||
"current_version": api.versions["web_current"],
|
"current_version": api.versions["web_current"],
|
||||||
"latest_version": api.versions["web_latest"],
|
"latest_version": api.versions["web_latest"],
|
||||||
@ -142,7 +142,7 @@ BINARY_SENSOR_TYPES: tuple[PiHoleBinarySensorEntityDescription, ...] = (
|
|||||||
PiHoleBinarySensorEntityDescription(
|
PiHoleBinarySensorEntityDescription(
|
||||||
key="ftl_update_available",
|
key="ftl_update_available",
|
||||||
name="FTL Update Available",
|
name="FTL Update Available",
|
||||||
device_class=DEVICE_CLASS_UPDATE,
|
device_class=BinarySensorDeviceClass.UPDATE,
|
||||||
extra_value=lambda api: {
|
extra_value=lambda api: {
|
||||||
"current_version": api.versions["FTL_current"],
|
"current_version": api.versions["FTL_current"],
|
||||||
"latest_version": api.versions["FTL_latest"],
|
"latest_version": api.versions["FTL_latest"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user