From d453f3809c5302245523519e49a6ee158270d931 Mon Sep 17 00:00:00 2001 From: Nathan Tilley Date: Sat, 23 Sep 2023 22:02:34 -0700 Subject: [PATCH] Clean up FAA Delays constants (#100788) Move const to platform --- .../components/faa_delays/binary_sensor.py | 30 ++++++++++++++++++- homeassistant/components/faa_delays/const.py | 30 ------------------- 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/homeassistant/components/faa_delays/binary_sensor.py b/homeassistant/components/faa_delays/binary_sensor.py index 54b22812c84..5cbb206f223 100644 --- a/homeassistant/components/faa_delays/binary_sensor.py +++ b/homeassistant/components/faa_delays/binary_sensor.py @@ -12,7 +12,35 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.update_coordinator import CoordinatorEntity -from .const import DOMAIN, FAA_BINARY_SENSORS +from .const import DOMAIN + +FAA_BINARY_SENSORS: tuple[BinarySensorEntityDescription, ...] = ( + BinarySensorEntityDescription( + key="GROUND_DELAY", + name="Ground Delay", + icon="mdi:airport", + ), + BinarySensorEntityDescription( + key="GROUND_STOP", + name="Ground Stop", + icon="mdi:airport", + ), + BinarySensorEntityDescription( + key="DEPART_DELAY", + name="Departure Delay", + icon="mdi:airplane-takeoff", + ), + BinarySensorEntityDescription( + key="ARRIVE_DELAY", + name="Arrival Delay", + icon="mdi:airplane-landing", + ), + BinarySensorEntityDescription( + key="CLOSURE", + name="Closure", + icon="mdi:airplane:off", + ), +) async def async_setup_entry( diff --git a/homeassistant/components/faa_delays/const.py b/homeassistant/components/faa_delays/const.py index f7ee8e7bad8..3b9bda33bfb 100644 --- a/homeassistant/components/faa_delays/const.py +++ b/homeassistant/components/faa_delays/const.py @@ -1,34 +1,4 @@ """Constants for the FAA Delays integration.""" from __future__ import annotations -from homeassistant.components.binary_sensor import BinarySensorEntityDescription - DOMAIN = "faa_delays" - -FAA_BINARY_SENSORS: tuple[BinarySensorEntityDescription, ...] = ( - BinarySensorEntityDescription( - key="GROUND_DELAY", - name="Ground Delay", - icon="mdi:airport", - ), - BinarySensorEntityDescription( - key="GROUND_STOP", - name="Ground Stop", - icon="mdi:airport", - ), - BinarySensorEntityDescription( - key="DEPART_DELAY", - name="Departure Delay", - icon="mdi:airplane-takeoff", - ), - BinarySensorEntityDescription( - key="ARRIVE_DELAY", - name="Arrival Delay", - icon="mdi:airplane-landing", - ), - BinarySensorEntityDescription( - key="CLOSURE", - name="Closure", - icon="mdi:airplane:off", - ), -)