From ad5933ce1e5be26e024f636933de447f169c4a35 Mon Sep 17 00:00:00 2001 From: Darsey Litzenberger Date: Tue, 14 Oct 2025 03:14:25 -0600 Subject: [PATCH] get rid of pointless enum --- components/app_status/binary_sensor.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/components/app_status/binary_sensor.py b/components/app_status/binary_sensor.py index ed9dfe4..86165e3 100644 --- a/components/app_status/binary_sensor.py +++ b/components/app_status/binary_sensor.py @@ -9,17 +9,12 @@ CONF_DETECT_STATUS = "detect_status" CONF_WARNING = "warning" CONF_ERROR = "error" -DETECT_STATUS_ENUM = { - CONF_WARNING: 1, - CONF_ERROR: 2, -} - app_status_ns = cg.esphome_ns.namespace("app_status") AppStatus = app_status_ns.class_("AppStatus", binary_sensor.BinarySensor, cg.Component) CONFIG_SCHEMA = binary_sensor.binary_sensor_schema(AppStatus).extend({ cv.GenerateID(): cv.declare_id(AppStatus), - cv.Optional(CONF_DETECT_STATUS, default=[CONF_WARNING, CONF_ERROR]): cv.ensure_list(cv.enum(DETECT_STATUS_ENUM)), + cv.Optional(CONF_DETECT_STATUS, default=[CONF_WARNING, CONF_ERROR]): cv.ensure_list(cv.one_of(CONF_ERROR, CONF_WARNING)), }).extend(cv.COMPONENT_SCHEMA) async def to_code(config):