diff --git a/homeassistant/components/habitica/__init__.py b/homeassistant/components/habitica/__init__.py index a08932d9c1b..af67178185d 100644 --- a/homeassistant/components/habitica/__init__.py +++ b/homeassistant/components/habitica/__init__.py @@ -12,6 +12,7 @@ from homeassistant.const import ( CONF_NAME, CONF_SENSORS, CONF_URL, + Platform, ) from homeassistant.core import HomeAssistant from homeassistant.helpers import config_validation as cv @@ -73,7 +74,7 @@ INSTANCE_LIST_SCHEMA = vol.All( ) CONFIG_SCHEMA = vol.Schema({DOMAIN: INSTANCE_LIST_SCHEMA}, extra=vol.ALLOW_EXTRA) -PLATFORMS = ["sensor"] +PLATFORMS = [Platform.SENSOR] SERVICE_API_CALL_SCHEMA = vol.Schema( { diff --git a/homeassistant/components/harmony/const.py b/homeassistant/components/harmony/const.py index c8e15ed0b0f..8df5b3d578c 100644 --- a/homeassistant/components/harmony/const.py +++ b/homeassistant/components/harmony/const.py @@ -1,8 +1,10 @@ """Constants for the Harmony component.""" +from homeassistant.const import Platform + DOMAIN = "harmony" SERVICE_SYNC = "sync" SERVICE_CHANGE_CHANNEL = "change_channel" -PLATFORMS = ["remote", "switch", "select"] +PLATFORMS = [Platform.REMOTE, Platform.SELECT, Platform.SWITCH] UNIQUE_ID = "unique_id" ACTIVITY_POWER_OFF = "PowerOff" HARMONY_OPTIONS_UPDATE = "harmony_options_update" diff --git a/homeassistant/components/hassio/__init__.py b/homeassistant/components/hassio/__init__.py index 7991c50563c..614ea928828 100644 --- a/homeassistant/components/hassio/__init__.py +++ b/homeassistant/components/hassio/__init__.py @@ -22,6 +22,7 @@ from homeassistant.const import ( EVENT_CORE_CONFIG_UPDATE, SERVICE_HOMEASSISTANT_RESTART, SERVICE_HOMEASSISTANT_STOP, + Platform, ) from homeassistant.core import DOMAIN as HASS_DOMAIN, HomeAssistant, callback from homeassistant.exceptions import HomeAssistantError @@ -68,7 +69,7 @@ _LOGGER = logging.getLogger(__name__) STORAGE_KEY = DOMAIN STORAGE_VERSION = 1 -PLATFORMS = ["binary_sensor", "sensor"] +PLATFORMS = [Platform.BINARY_SENSOR, Platform.SENSOR] CONF_FRONTEND_REPO = "development_repo" diff --git a/homeassistant/components/heos/__init__.py b/homeassistant/components/heos/__init__.py index 2dbab5e9409..bbe611c1db9 100644 --- a/homeassistant/components/heos/__init__.py +++ b/homeassistant/components/heos/__init__.py @@ -8,9 +8,8 @@ import logging from pyheos import Heos, HeosError, const as heos_const import voluptuous as vol -from homeassistant.components.media_player.const import DOMAIN as MEDIA_PLAYER_DOMAIN from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry -from homeassistant.const import CONF_HOST, EVENT_HOMEASSISTANT_STOP +from homeassistant.const import CONF_HOST, EVENT_HOMEASSISTANT_STOP, Platform from homeassistant.core import HomeAssistant, callback from homeassistant.exceptions import ConfigEntryNotReady, HomeAssistantError import homeassistant.helpers.config_validation as cv @@ -35,7 +34,7 @@ from .const import ( SIGNAL_HEOS_UPDATED, ) -PLATFORMS = [MEDIA_PLAYER_DOMAIN] +PLATFORMS = [Platform.MEDIA_PLAYER] CONFIG_SCHEMA = vol.Schema( vol.All( @@ -130,7 +129,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: DATA_CONTROLLER_MANAGER: controller_manager, DATA_GROUP_MANAGER: group_manager, DATA_SOURCE_MANAGER: source_manager, - MEDIA_PLAYER_DOMAIN: players, + Platform.MEDIA_PLAYER: players, # Maps player_id to entity_id. Populated by the individual HeosMediaPlayer entities. DATA_ENTITY_ID_MAP: {}, } @@ -228,7 +227,7 @@ class ControllerManager: ) # update entity registry entity_id = self._entity_registry.async_get_entity_id( - MEDIA_PLAYER_DOMAIN, DOMAIN, str(old_id) + Platform.MEDIA_PLAYER, DOMAIN, str(old_id) ) if entity_id: self._entity_registry.async_update_entity( @@ -355,7 +354,7 @@ class GroupManager: # Avoid calling async_update_groups when `DATA_ENTITY_ID_MAP` has not been # fully populated yet. This may only happen during early startup. if ( - len(self._hass.data[DOMAIN][MEDIA_PLAYER_DOMAIN]) + len(self._hass.data[DOMAIN][Platform.MEDIA_PLAYER]) <= len(self._hass.data[DOMAIN][DATA_ENTITY_ID_MAP]) and not self._initialized ): diff --git a/homeassistant/components/hisense_aehw4a1/__init__.py b/homeassistant/components/hisense_aehw4a1/__init__.py index 1134ac4181d..bc38d1df53f 100644 --- a/homeassistant/components/hisense_aehw4a1/__init__.py +++ b/homeassistant/components/hisense_aehw4a1/__init__.py @@ -8,14 +8,14 @@ import voluptuous as vol from homeassistant import config_entries from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN -from homeassistant.const import CONF_IP_ADDRESS +from homeassistant.const import CONF_IP_ADDRESS, Platform import homeassistant.helpers.config_validation as cv from .const import DOMAIN _LOGGER = logging.getLogger(__name__) -PLATFORMS = [CLIMATE_DOMAIN] +PLATFORMS = [Platform.CLIMATE] def coerce_ip(value): diff --git a/homeassistant/components/hlk_sw16/__init__.py b/homeassistant/components/hlk_sw16/__init__.py index e36af7676ed..9fae14f8d1a 100644 --- a/homeassistant/components/hlk_sw16/__init__.py +++ b/homeassistant/components/hlk_sw16/__init__.py @@ -5,7 +5,7 @@ from hlk_sw16 import create_hlk_sw16_connection import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT -from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT, CONF_SWITCHES +from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT, CONF_SWITCHES, Platform from homeassistant.core import callback import homeassistant.helpers.config_validation as cv from homeassistant.helpers.dispatcher import ( @@ -24,7 +24,7 @@ from .const import ( _LOGGER = logging.getLogger(__name__) -PLATFORMS = ["switch"] +PLATFORMS = [Platform.SWITCH] DATA_DEVICE_REGISTER = "hlk_sw16_device_register" DATA_DEVICE_LISTENER = "hlk_sw16_device_listener" diff --git a/homeassistant/components/home_connect/__init__.py b/homeassistant/components/home_connect/__init__.py index 1fc446af401..26448893438 100644 --- a/homeassistant/components/home_connect/__init__.py +++ b/homeassistant/components/home_connect/__init__.py @@ -7,7 +7,7 @@ from requests import HTTPError import voluptuous as vol from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET +from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import config_entry_oauth2_flow, config_validation as cv from homeassistant.helpers.typing import ConfigType @@ -32,7 +32,7 @@ CONFIG_SCHEMA = vol.Schema( extra=vol.ALLOW_EXTRA, ) -PLATFORMS = ["binary_sensor", "light", "sensor", "switch"] +PLATFORMS = [Platform.BINARY_SENSOR, Platform.LIGHT, Platform.SENSOR, Platform.SWITCH] async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: diff --git a/homeassistant/components/homematicip_cloud/const.py b/homeassistant/components/homematicip_cloud/const.py index 31ccb8b9bc7..a0f1c84015f 100644 --- a/homeassistant/components/homematicip_cloud/const.py +++ b/homeassistant/components/homematicip_cloud/const.py @@ -1,30 +1,21 @@ """Constants for the HomematicIP Cloud component.""" import logging -from homeassistant.components.alarm_control_panel import ( - DOMAIN as ALARM_CONTROL_PANEL_DOMAIN, -) -from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN -from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN -from homeassistant.components.cover import DOMAIN as COVER_DOMAIN -from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN -from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN -from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN -from homeassistant.components.weather import DOMAIN as WEATHER_DOMAIN +from homeassistant.const import Platform _LOGGER = logging.getLogger(".") DOMAIN = "homematicip_cloud" PLATFORMS = [ - ALARM_CONTROL_PANEL_DOMAIN, - BINARY_SENSOR_DOMAIN, - CLIMATE_DOMAIN, - COVER_DOMAIN, - LIGHT_DOMAIN, - SENSOR_DOMAIN, - SWITCH_DOMAIN, - WEATHER_DOMAIN, + Platform.ALARM_CONTROL_PANEL, + Platform.BINARY_SENSOR, + Platform.CLIMATE, + Platform.COVER, + Platform.LIGHT, + Platform.SENSOR, + Platform.SWITCH, + Platform.WEATHER, ] CONF_ACCESSPOINT = "accesspoint" diff --git a/homeassistant/components/honeywell/__init__.py b/homeassistant/components/honeywell/__init__.py index c61e4fc18eb..485562f8b5d 100644 --- a/homeassistant/components/honeywell/__init__.py +++ b/homeassistant/components/honeywell/__init__.py @@ -4,7 +4,7 @@ from datetime import timedelta import somecomfort -from homeassistant.const import CONF_PASSWORD, CONF_USERNAME +from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, Platform from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.util import Throttle @@ -12,7 +12,7 @@ from .const import _LOGGER, CONF_DEV_ID, CONF_LOC_ID, DOMAIN UPDATE_LOOP_SLEEP_TIME = 5 MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=300) -PLATFORMS = ["climate"] +PLATFORMS = [Platform.CLIMATE] async def async_setup_entry(hass, config): diff --git a/homeassistant/components/huawei_lte/__init__.py b/homeassistant/components/huawei_lte/__init__.py index f63b84254fc..4f4451330f6 100644 --- a/homeassistant/components/huawei_lte/__init__.py +++ b/homeassistant/components/huawei_lte/__init__.py @@ -22,13 +22,7 @@ from requests.exceptions import Timeout from url_normalize import url_normalize import voluptuous as vol -from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN -from homeassistant.components.device_tracker.const import ( - DOMAIN as DEVICE_TRACKER_DOMAIN, -) from homeassistant.components.notify import DOMAIN as NOTIFY_DOMAIN -from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN -from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import ( ATTR_MODEL, @@ -40,6 +34,7 @@ from homeassistant.const import ( CONF_URL, CONF_USERNAME, EVENT_HOMEASSISTANT_STOP, + Platform, ) from homeassistant.core import HomeAssistant, ServiceCall from homeassistant.exceptions import ConfigEntryNotReady @@ -123,12 +118,12 @@ CONFIG_SCHEMA = vol.Schema( SERVICE_SCHEMA = vol.Schema({vol.Optional(CONF_URL): cv.url}) -CONFIG_ENTRY_PLATFORMS = ( - BINARY_SENSOR_DOMAIN, - DEVICE_TRACKER_DOMAIN, - SENSOR_DOMAIN, - SWITCH_DOMAIN, -) +PLATFORMS = [ + Platform.BINARY_SENSOR, + Platform.DEVICE_TRACKER, + Platform.SENSOR, + Platform.SWITCH, +] @attr.s @@ -455,7 +450,7 @@ async def async_setup_entry( # noqa: C901 ) # Forward config entry setup to platforms - hass.config_entries.async_setup_platforms(entry, CONFIG_ENTRY_PLATFORMS) + hass.config_entries.async_setup_platforms(entry, PLATFORMS) # Notify doesn't support config entry setup yet, load with discovery for now await discovery.async_load_platform( @@ -495,9 +490,7 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> """Unload config entry.""" # Forward config entry unload to platforms - await hass.config_entries.async_unload_platforms( - config_entry, CONFIG_ENTRY_PLATFORMS - ) + await hass.config_entries.async_unload_platforms(config_entry, PLATFORMS) # Forget about the router and invoke its cleanup router = hass.data[DOMAIN].routers.pop(config_entry.unique_id) diff --git a/homeassistant/components/hue/bridge.py b/homeassistant/components/hue/bridge.py index 5005f858a58..cda639bcf6c 100644 --- a/homeassistant/components/hue/bridge.py +++ b/homeassistant/components/hue/bridge.py @@ -14,7 +14,7 @@ import async_timeout from homeassistant import core from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry -from homeassistant.const import CONF_API_KEY, CONF_HOST +from homeassistant.const import CONF_API_KEY, CONF_HOST, Platform from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers import aiohttp_client @@ -26,8 +26,14 @@ from .v2.hue_event import async_setup_hue_events # How long should we sleep if the hub is busy HUB_BUSY_SLEEP = 0.5 -PLATFORMS_v1 = ["light", "binary_sensor", "sensor"] -PLATFORMS_v2 = ["light", "binary_sensor", "sensor", "scene", "switch"] +PLATFORMS_v1 = [Platform.BINARY_SENSOR, Platform.LIGHT, Platform.SENSOR] +PLATFORMS_v2 = [ + Platform.BINARY_SENSOR, + Platform.LIGHT, + Platform.SCENE, + Platform.SENSOR, + Platform.SWITCH, +] class HueBridge: diff --git a/homeassistant/components/huisbaasje/__init__.py b/homeassistant/components/huisbaasje/__init__.py index 6c8df713344..f2b4ef8d4ef 100644 --- a/homeassistant/components/huisbaasje/__init__.py +++ b/homeassistant/components/huisbaasje/__init__.py @@ -6,7 +6,7 @@ import async_timeout from huisbaasje import Huisbaasje, HuisbaasjeException from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_PASSWORD, CONF_USERNAME +from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed @@ -23,7 +23,7 @@ from .const import ( SOURCE_TYPES, ) -PLATFORMS = ["sensor"] +PLATFORMS = [Platform.SENSOR] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/hunterdouglas_powerview/__init__.py b/homeassistant/components/hunterdouglas_powerview/__init__.py index a9c620a4baa..304d7e13cc1 100644 --- a/homeassistant/components/hunterdouglas_powerview/__init__.py +++ b/homeassistant/components/hunterdouglas_powerview/__init__.py @@ -13,7 +13,7 @@ from aiopvapi.userdata import UserData import async_timeout from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_HOST +from homeassistant.const import CONF_HOST, Platform from homeassistant.core import HomeAssistant, callback from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers.aiohttp_client import async_get_clientsession @@ -55,7 +55,7 @@ PARALLEL_UPDATES = 1 CONFIG_SCHEMA = cv.deprecated(DOMAIN) -PLATFORMS = ["cover", "scene", "sensor"] +PLATFORMS = [Platform.COVER, Platform.SCENE, Platform.SENSOR] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/hvv_departures/__init__.py b/homeassistant/components/hvv_departures/__init__.py index 09b9d516bad..3c090249bc0 100644 --- a/homeassistant/components/hvv_departures/__init__.py +++ b/homeassistant/components/hvv_departures/__init__.py @@ -1,16 +1,14 @@ """The HVV integration.""" -from homeassistant.components.binary_sensor import DOMAIN as DOMAIN_BINARY_SENSOR -from homeassistant.components.sensor import DOMAIN as DOMAIN_SENSOR from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME +from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import aiohttp_client from .const import DOMAIN from .hub import GTIHub -PLATFORMS = [DOMAIN_SENSOR, DOMAIN_BINARY_SENSOR] +PLATFORMS = [Platform.BINARY_SENSOR, Platform.SENSOR] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: diff --git a/homeassistant/components/ialarm/__init__.py b/homeassistant/components/ialarm/__init__.py index af8fd0695e4..db9aa000066 100644 --- a/homeassistant/components/ialarm/__init__.py +++ b/homeassistant/components/ialarm/__init__.py @@ -7,14 +7,14 @@ from pyialarm import IAlarm from homeassistant.components.alarm_control_panel import SCAN_INTERVAL from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_HOST, CONF_PORT +from homeassistant.const import CONF_HOST, CONF_PORT, Platform from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed from .const import DATA_COORDINATOR, DOMAIN, IALARM_TO_HASS -PLATFORMS = ["alarm_control_panel"] +PLATFORMS = [Platform.ALARM_CONTROL_PANEL] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/icloud/const.py b/homeassistant/components/icloud/const.py index 58c62f8a868..231f2cc1d0a 100644 --- a/homeassistant/components/icloud/const.py +++ b/homeassistant/components/icloud/const.py @@ -1,4 +1,5 @@ """iCloud component constants.""" +from homeassistant.const import Platform DOMAIN = "icloud" @@ -14,7 +15,7 @@ DEFAULT_GPS_ACCURACY_THRESHOLD = 500 # meters STORAGE_KEY = DOMAIN STORAGE_VERSION = 2 -PLATFORMS = ["device_tracker", "sensor"] +PLATFORMS = [Platform.DEVICE_TRACKER, Platform.SENSOR] # pyicloud.AppleDevice status DEVICE_BATTERY_LEVEL = "batteryLevel" diff --git a/homeassistant/components/iotawatt/__init__.py b/homeassistant/components/iotawatt/__init__.py index 7987004e594..55fc701cffd 100644 --- a/homeassistant/components/iotawatt/__init__.py +++ b/homeassistant/components/iotawatt/__init__.py @@ -1,11 +1,12 @@ """The iotawatt integration.""" from homeassistant.config_entries import ConfigEntry +from homeassistant.const import Platform from homeassistant.core import HomeAssistant from .const import DOMAIN from .coordinator import IotawattUpdater -PLATFORMS = ("sensor",) +PLATFORMS = [Platform.SENSOR] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: diff --git a/homeassistant/components/ipma/__init__.py b/homeassistant/components/ipma/__init__.py index 1a26d375653..f24f8104bd8 100644 --- a/homeassistant/components/ipma/__init__.py +++ b/homeassistant/components/ipma/__init__.py @@ -1,10 +1,12 @@ """Component for the Portuguese weather service - IPMA.""" +from homeassistant.const import Platform + from .config_flow import IpmaFlowHandler # noqa: F401 from .const import DOMAIN # noqa: F401 DEFAULT_NAME = "ipma" -PLATFORMS = ["weather"] +PLATFORMS = [Platform.WEATHER] async def async_setup_entry(hass, entry): diff --git a/homeassistant/components/ipp/__init__.py b/homeassistant/components/ipp/__init__.py index d5930ac5f56..23ee5adc0e4 100644 --- a/homeassistant/components/ipp/__init__.py +++ b/homeassistant/components/ipp/__init__.py @@ -1,15 +1,20 @@ """The Internet Printing Protocol (IPP) integration.""" from __future__ import annotations -from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_HOST, CONF_PORT, CONF_SSL, CONF_VERIFY_SSL +from homeassistant.const import ( + CONF_HOST, + CONF_PORT, + CONF_SSL, + CONF_VERIFY_SSL, + Platform, +) from homeassistant.core import HomeAssistant from .const import CONF_BASE_PATH, DOMAIN from .coordinator import IPPDataUpdateCoordinator -PLATFORMS = [SENSOR_DOMAIN] +PLATFORMS = [Platform.SENSOR] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: diff --git a/homeassistant/components/iqvia/__init__.py b/homeassistant/components/iqvia/__init__.py index b0f7086cad7..56d90874eba 100644 --- a/homeassistant/components/iqvia/__init__.py +++ b/homeassistant/components/iqvia/__init__.py @@ -11,6 +11,7 @@ from pyiqvia import Client from pyiqvia.errors import IQVIAError from homeassistant.config_entries import ConfigEntry +from homeassistant.const import Platform from homeassistant.core import HomeAssistant, callback from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers import aiohttp_client @@ -37,7 +38,7 @@ from .const import ( DEFAULT_ATTRIBUTION = "Data provided by IQVIA™" DEFAULT_SCAN_INTERVAL = timedelta(minutes=30) -PLATFORMS = ["sensor"] +PLATFORMS = [Platform.SENSOR] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: diff --git a/homeassistant/components/islamic_prayer_times/__init__.py b/homeassistant/components/islamic_prayer_times/__init__.py index 8375b9d4c12..a55838970fe 100644 --- a/homeassistant/components/islamic_prayer_times/__init__.py +++ b/homeassistant/components/islamic_prayer_times/__init__.py @@ -7,6 +7,7 @@ from requests.exceptions import ConnectionError as ConnError import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT +from homeassistant.const import Platform from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers import config_validation as cv from homeassistant.helpers.dispatcher import async_dispatcher_send @@ -23,7 +24,7 @@ from .const import ( _LOGGER = logging.getLogger(__name__) -PLATFORMS = ["sensor"] +PLATFORMS = [Platform.SENSOR] CONFIG_SCHEMA = vol.Schema( vol.All( diff --git a/homeassistant/components/isy994/const.py b/homeassistant/components/isy994/const.py index 8e634006ec2..0a7b02c1dac 100644 --- a/homeassistant/components/isy994/const.py +++ b/homeassistant/components/isy994/const.py @@ -15,14 +15,12 @@ from homeassistant.components.binary_sensor import ( DEVICE_CLASS_SMOKE, DEVICE_CLASS_SOUND, DEVICE_CLASS_VIBRATION, - DOMAIN as BINARY_SENSOR, ) from homeassistant.components.climate.const import ( CURRENT_HVAC_COOL, CURRENT_HVAC_FAN, CURRENT_HVAC_HEAT, CURRENT_HVAC_IDLE, - DOMAIN as CLIMATE, FAN_AUTO, FAN_HIGH, FAN_MEDIUM, @@ -37,12 +35,6 @@ from homeassistant.components.climate.const import ( PRESET_AWAY, PRESET_BOOST, ) -from homeassistant.components.cover import DOMAIN as COVER -from homeassistant.components.fan import DOMAIN as FAN -from homeassistant.components.light import DOMAIN as LIGHT -from homeassistant.components.lock import DOMAIN as LOCK -from homeassistant.components.sensor import DOMAIN as SENSOR -from homeassistant.components.switch import DOMAIN as SWITCH from homeassistant.const import ( CONCENTRATION_PARTS_PER_MILLION, CURRENCY_CENT, @@ -109,6 +101,7 @@ from homeassistant.const import ( VOLUME_FLOW_RATE_CUBIC_METERS_PER_HOUR, VOLUME_GALLONS, VOLUME_LITERS, + Platform, ) _LOGGER = logging.getLogger(__package__) @@ -133,14 +126,29 @@ DEFAULT_VAR_SENSOR_STRING = "HA." KEY_ACTIONS = "actions" KEY_STATUS = "status" -PLATFORMS = [BINARY_SENSOR, SENSOR, LOCK, FAN, COVER, LIGHT, SWITCH, CLIMATE] -PROGRAM_PLATFORMS = [BINARY_SENSOR, LOCK, FAN, COVER, SWITCH] +PLATFORMS = [ + Platform.BINARY_SENSOR, + Platform.CLIMATE, + Platform.COVER, + Platform.FAN, + Platform.LIGHT, + Platform.LOCK, + Platform.SENSOR, + Platform.SWITCH, +] +PROGRAM_PLATFORMS = [ + Platform.BINARY_SENSOR, + Platform.COVER, + Platform.FAN, + Platform.LOCK, + Platform.SWITCH, +] SUPPORTED_BIN_SENS_CLASSES = ["moisture", "opening", "motion", "climate"] # ISY Scenes are more like Switches than Home Assistant Scenes # (they can turn off, and report their state) -ISY_GROUP_PLATFORM = SWITCH +ISY_GROUP_PLATFORM = Platform.SWITCH ISY994_ISY = "isy" ISY994_NODES = "isy994_nodes" @@ -211,7 +219,7 @@ UOM_PERCENTAGE = "51" # Insteon Types: https://www.universal-devices.com/developers/wsdk/5.0.4/1_fam.xml # Z-Wave Categories: https://www.universal-devices.com/developers/wsdk/5.0.4/4_fam.xml NODE_FILTERS = { - BINARY_SENSOR: { + Platform.BINARY_SENSOR: { FILTER_UOM: [UOM_ON_OFF], FILTER_STATES: [], FILTER_NODE_DEF_ID: [ @@ -231,7 +239,7 @@ NODE_FILTERS = { ], # Does a startswith() match; include the dot FILTER_ZWAVE_CAT: (["104", "112", "138"] + list(map(str, range(148, 180)))), }, - SENSOR: { + Platform.SENSOR: { # This is just a more-readable way of including MOST uoms between 1-100 # (Remember that range() is non-inclusive of the stop value) FILTER_UOM: ( @@ -255,28 +263,28 @@ NODE_FILTERS = { FILTER_INSTEON_TYPE: ["0.16.", "0.17.", "0.18.", "9.0.", "9.7."], FILTER_ZWAVE_CAT: (["118", "143"] + list(map(str, range(180, 186)))), }, - LOCK: { + Platform.LOCK: { FILTER_UOM: ["11"], FILTER_STATES: ["locked", "unlocked"], FILTER_NODE_DEF_ID: ["DoorLock"], FILTER_INSTEON_TYPE: [TYPE_CATEGORY_LOCK, "4.64."], FILTER_ZWAVE_CAT: ["111"], }, - FAN: { + Platform.FAN: { FILTER_UOM: [], FILTER_STATES: ["off", "low", "med", "high"], FILTER_NODE_DEF_ID: ["FanLincMotor"], FILTER_INSTEON_TYPE: ["1.46."], FILTER_ZWAVE_CAT: [], }, - COVER: { + Platform.COVER: { FILTER_UOM: [UOM_BARRIER], FILTER_STATES: ["open", "closed", "closing", "opening", "stopped"], FILTER_NODE_DEF_ID: ["DimmerMotorSwitch_ADV"], FILTER_INSTEON_TYPE: [TYPE_CATEGORY_COVER], FILTER_ZWAVE_CAT: [], }, - LIGHT: { + Platform.LIGHT: { FILTER_UOM: ["51"], FILTER_STATES: ["on", "off", "%"], FILTER_NODE_DEF_ID: [ @@ -293,7 +301,7 @@ NODE_FILTERS = { FILTER_INSTEON_TYPE: [TYPE_CATEGORY_DIMMABLE], FILTER_ZWAVE_CAT: ["109", "119"], }, - SWITCH: { + Platform.SWITCH: { FILTER_UOM: ["78"], FILTER_STATES: ["on", "off"], FILTER_NODE_DEF_ID: [ @@ -323,7 +331,7 @@ NODE_FILTERS = { ], FILTER_ZWAVE_CAT: ["121", "122", "123", "137", "141", "147"], }, - CLIMATE: { + Platform.CLIMATE: { FILTER_UOM: [UOM_ON_OFF], FILTER_STATES: ["heating", "cooling", "idle", "fan_only", "off"], FILTER_NODE_DEF_ID: ["TempLinc", "Thermostat"], diff --git a/homeassistant/components/izone/__init__.py b/homeassistant/components/izone/__init__.py index 2ac66963638..d49de8c0e55 100644 --- a/homeassistant/components/izone/__init__.py +++ b/homeassistant/components/izone/__init__.py @@ -2,7 +2,7 @@ import voluptuous as vol from homeassistant import config_entries -from homeassistant.const import CONF_EXCLUDE +from homeassistant.const import CONF_EXCLUDE, Platform from homeassistant.core import HomeAssistant import homeassistant.helpers.config_validation as cv from homeassistant.helpers.typing import ConfigType @@ -10,7 +10,7 @@ from homeassistant.helpers.typing import ConfigType from .const import DATA_CONFIG, IZONE from .discovery import async_start_discovery_service, async_stop_discovery_service -PLATFORMS = ["climate"] +PLATFORMS = [Platform.CLIMATE] CONFIG_SCHEMA = vol.Schema( { diff --git a/homeassistant/components/juicenet/__init__.py b/homeassistant/components/juicenet/__init__.py index 41097589244..92d8de8bc0a 100644 --- a/homeassistant/components/juicenet/__init__.py +++ b/homeassistant/components/juicenet/__init__.py @@ -7,7 +7,7 @@ from pyjuicenet import Api, TokenError import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry -from homeassistant.const import CONF_ACCESS_TOKEN +from homeassistant.const import CONF_ACCESS_TOKEN, Platform from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers import config_validation as cv @@ -20,7 +20,7 @@ from .device import JuiceNetApi _LOGGER = logging.getLogger(__name__) -PLATFORMS = ["sensor", "switch"] +PLATFORMS = [Platform.SENSOR, Platform.SWITCH] CONFIG_SCHEMA = vol.Schema( vol.All( diff --git a/homeassistant/components/keenetic_ndms2/__init__.py b/homeassistant/components/keenetic_ndms2/__init__.py index 2af7434d2e4..94a249df209 100644 --- a/homeassistant/components/keenetic_ndms2/__init__.py +++ b/homeassistant/components/keenetic_ndms2/__init__.py @@ -3,10 +3,8 @@ from __future__ import annotations import logging -from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN -from homeassistant.components.device_tracker import DOMAIN as DEVICE_TRACKER_DOMAIN from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_HOST, CONF_SCAN_INTERVAL +from homeassistant.const import CONF_HOST, CONF_SCAN_INTERVAL, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import device_registry, entity_registry @@ -25,7 +23,7 @@ from .const import ( ) from .router import KeeneticRouter -PLATFORMS = [BINARY_SENSOR_DOMAIN, DEVICE_TRACKER_DOMAIN] +PLATFORMS = [Platform.BINARY_SENSOR, Platform.DEVICE_TRACKER] _LOGGER = logging.getLogger(__name__) @@ -80,7 +78,7 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> for entity_entry in list(ent_reg.entities.values()): if ( entity_entry.config_entry_id == config_entry.entry_id - and entity_entry.domain == DEVICE_TRACKER_DOMAIN + and entity_entry.domain == Platform.DEVICE_TRACKER ): mac = entity_entry.unique_id.partition("_")[0] if mac not in keep_devices: diff --git a/homeassistant/components/kmtronic/__init__.py b/homeassistant/components/kmtronic/__init__.py index 72c0c772aec..a7637879fc1 100644 --- a/homeassistant/components/kmtronic/__init__.py +++ b/homeassistant/components/kmtronic/__init__.py @@ -8,14 +8,14 @@ from pykmtronic.auth import Auth from pykmtronic.hub import KMTronicHubAPI from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME +from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import aiohttp_client from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed from .const import DATA_COORDINATOR, DATA_HUB, DOMAIN, MANUFACTURER, UPDATE_LISTENER -PLATFORMS = ["switch"] +PLATFORMS = [Platform.SWITCH] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/kodi/__init__.py b/homeassistant/components/kodi/__init__.py index 7c7740e8fe8..f5e58f3c6a1 100644 --- a/homeassistant/components/kodi/__init__.py +++ b/homeassistant/components/kodi/__init__.py @@ -12,6 +12,7 @@ from homeassistant.const import ( CONF_SSL, CONF_USERNAME, EVENT_HOMEASSISTANT_STOP, + Platform, ) from homeassistant.core import HomeAssistant from homeassistant.helpers.aiohttp_client import async_get_clientsession @@ -25,7 +26,7 @@ from .const import ( ) _LOGGER = logging.getLogger(__name__) -PLATFORMS = ["media_player"] +PLATFORMS = [Platform.MEDIA_PLAYER] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: diff --git a/homeassistant/components/konnected/__init__.py b/homeassistant/components/konnected/__init__.py index 43537154e41..f018d1a5133 100644 --- a/homeassistant/components/konnected/__init__.py +++ b/homeassistant/components/konnected/__init__.py @@ -31,6 +31,7 @@ from homeassistant.const import ( CONF_ZONE, STATE_OFF, STATE_ON, + Platform, ) from homeassistant.core import HomeAssistant from homeassistant.helpers import config_validation as cv @@ -216,7 +217,7 @@ CONFIG_SCHEMA = vol.Schema( ) YAML_CONFIGS = "yaml_configs" -PLATFORMS = ["binary_sensor", "sensor", "switch"] +PLATFORMS = [Platform.BINARY_SENSOR, Platform.SENSOR, Platform.SWITCH] async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: diff --git a/homeassistant/components/kostal_plenticore/__init__.py b/homeassistant/components/kostal_plenticore/__init__.py index f5c973cc499..a42ad0a64ff 100644 --- a/homeassistant/components/kostal_plenticore/__init__.py +++ b/homeassistant/components/kostal_plenticore/__init__.py @@ -4,6 +4,7 @@ import logging from kostal.plenticore import PlenticoreApiException from homeassistant.config_entries import ConfigEntry +from homeassistant.const import Platform from homeassistant.core import HomeAssistant from .const import DOMAIN @@ -11,7 +12,7 @@ from .helper import Plenticore _LOGGER = logging.getLogger(__name__) -PLATFORMS = ["select", "sensor", "switch"] +PLATFORMS = [Platform.SELECT, Platform.SENSOR, Platform.SWITCH] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: diff --git a/homeassistant/components/kraken/__init__.py b/homeassistant/components/kraken/__init__.py index 5b1fd2626e3..bf01f27673d 100644 --- a/homeassistant/components/kraken/__init__.py +++ b/homeassistant/components/kraken/__init__.py @@ -10,7 +10,7 @@ import krakenex import pykrakenapi from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_SCAN_INTERVAL +from homeassistant.const import CONF_SCAN_INTERVAL, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers.dispatcher import async_dispatcher_send from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed @@ -27,7 +27,7 @@ from .utils import get_tradable_asset_pairs CALL_RATE_LIMIT_SLEEP = 1 -PLATFORMS = ["sensor"] +PLATFORMS = [Platform.SENSOR] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/kulersky/__init__.py b/homeassistant/components/kulersky/__init__.py index 0ddac1850d7..39c0d0a5b84 100644 --- a/homeassistant/components/kulersky/__init__.py +++ b/homeassistant/components/kulersky/__init__.py @@ -1,11 +1,12 @@ """Kuler Sky lights integration.""" from homeassistant.config_entries import ConfigEntry +from homeassistant.const import Platform from homeassistant.core import HomeAssistant from .const import DATA_ADDRESSES, DATA_DISCOVERY_SUBSCRIPTION, DOMAIN -PLATFORMS = ["light"] +PLATFORMS = [Platform.LIGHT] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: diff --git a/homeassistant/components/lcn/const.py b/homeassistant/components/lcn/const.py index faef86dc70a..f2059827e84 100644 --- a/homeassistant/components/lcn/const.py +++ b/homeassistant/components/lcn/const.py @@ -8,9 +8,18 @@ from homeassistant.const import ( TEMP_CELSIUS, TEMP_FAHRENHEIT, TEMP_KELVIN, + Platform, ) -PLATFORMS = ["binary_sensor", "climate", "cover", "light", "scene", "sensor", "switch"] +PLATFORMS = [ + Platform.BINARY_SENSOR, + Platform.CLIMATE, + Platform.COVER, + Platform.LIGHT, + Platform.SCENE, + Platform.SENSOR, + Platform.SWITCH, +] DOMAIN = "lcn" DATA_LCN = "lcn" diff --git a/homeassistant/components/lifx/__init__.py b/homeassistant/components/lifx/__init__.py index b0b67450b5e..6d967ea9c69 100644 --- a/homeassistant/components/lifx/__init__.py +++ b/homeassistant/components/lifx/__init__.py @@ -3,7 +3,7 @@ import voluptuous as vol from homeassistant import config_entries from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN -from homeassistant.const import CONF_PORT +from homeassistant.const import CONF_PORT, Platform import homeassistant.helpers.config_validation as cv from .const import DOMAIN @@ -26,7 +26,7 @@ CONFIG_SCHEMA = vol.Schema( DATA_LIFX_MANAGER = "lifx_manager" -PLATFORMS = [LIGHT_DOMAIN] +PLATFORMS = [Platform.LIGHT] async def async_setup(hass, config): diff --git a/homeassistant/components/litejet/const.py b/homeassistant/components/litejet/const.py index 82521092106..baeadd7f4a9 100644 --- a/homeassistant/components/litejet/const.py +++ b/homeassistant/components/litejet/const.py @@ -1,10 +1,11 @@ """LiteJet constants.""" +from homeassistant.const import Platform DOMAIN = "litejet" CONF_EXCLUDE_NAMES = "exclude_names" CONF_INCLUDE_SWITCHES = "include_switches" -PLATFORMS = ["light", "switch", "scene"] +PLATFORMS = [Platform.LIGHT, Platform.SCENE, Platform.SWITCH] CONF_DEFAULT_TRANSITION = "default_transition" diff --git a/homeassistant/components/litterrobot/__init__.py b/homeassistant/components/litterrobot/__init__.py index d972ecc79d9..90c432010d7 100644 --- a/homeassistant/components/litterrobot/__init__.py +++ b/homeassistant/components/litterrobot/__init__.py @@ -2,19 +2,21 @@ from pylitterbot.exceptions import LitterRobotException, LitterRobotLoginException -from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN -from homeassistant.components.select import DOMAIN as SELECT_DOMAIN -from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN -from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN -from homeassistant.components.vacuum import DOMAIN as VACUUM_DOMAIN from homeassistant.config_entries import ConfigEntry +from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady from .const import DOMAIN from .hub import LitterRobotHub -PLATFORMS = [BUTTON_DOMAIN, SELECT_DOMAIN, SENSOR_DOMAIN, SWITCH_DOMAIN, VACUUM_DOMAIN] +PLATFORMS = [ + Platform.BUTTON, + Platform.SELECT, + Platform.SENSOR, + Platform.SWITCH, + Platform.VACUUM, +] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: diff --git a/homeassistant/components/local_ip/const.py b/homeassistant/components/local_ip/const.py index 0bac6d874d1..b079ec87663 100644 --- a/homeassistant/components/local_ip/const.py +++ b/homeassistant/components/local_ip/const.py @@ -1,6 +1,7 @@ """Local IP constants.""" +from homeassistant.const import Platform DOMAIN = "local_ip" -PLATFORMS = ["sensor"] +PLATFORMS = [Platform.SENSOR] SENSOR = "address" diff --git a/homeassistant/components/locative/__init__.py b/homeassistant/components/locative/__init__.py index 548b0a2d1fe..ec61cbbcdc7 100644 --- a/homeassistant/components/locative/__init__.py +++ b/homeassistant/components/locative/__init__.py @@ -7,13 +7,13 @@ import logging from aiohttp import web import voluptuous as vol -from homeassistant.components.device_tracker import DOMAIN as DEVICE_TRACKER from homeassistant.const import ( ATTR_ID, ATTR_LATITUDE, ATTR_LONGITUDE, CONF_WEBHOOK_ID, STATE_NOT_HOME, + Platform, ) from homeassistant.helpers import config_entry_flow import homeassistant.helpers.config_validation as cv @@ -24,7 +24,7 @@ _LOGGER = logging.getLogger(__name__) DOMAIN = "locative" TRACKER_UPDATE = f"{DOMAIN}_tracker_update" -PLATFORMS = [DEVICE_TRACKER] +PLATFORMS = [Platform.DEVICE_TRACKER] ATTR_DEVICE_ID = "device" ATTR_TRIGGER = "trigger" @@ -82,7 +82,7 @@ async def handle_webhook(hass, webhook_id, request): return web.Response(text=f"Setting location to {location_name}") if direction == "exit": - current_state = hass.states.get(f"{DEVICE_TRACKER}.{device}") + current_state = hass.states.get(f"{Platform.DEVICE_TRACKER}.{device}") if current_state is None or current_state.state == location_name: location_name = STATE_NOT_HOME diff --git a/homeassistant/components/logi_circle/__init__.py b/homeassistant/components/logi_circle/__init__.py index 45b34928a30..01034a3a5ca 100644 --- a/homeassistant/components/logi_circle/__init__.py +++ b/homeassistant/components/logi_circle/__init__.py @@ -18,6 +18,7 @@ from homeassistant.const import ( CONF_MONITORED_CONDITIONS, CONF_SENSORS, EVENT_HOMEASSISTANT_STOP, + Platform, ) from homeassistant.helpers import config_validation as cv from homeassistant.helpers.dispatcher import async_dispatcher_send @@ -48,7 +49,7 @@ SERVICE_LIVESTREAM_RECORD = "livestream_record" ATTR_VALUE = "value" ATTR_DURATION = "duration" -PLATFORMS = ["camera", "sensor"] +PLATFORMS = [Platform.CAMERA, Platform.SENSOR] SENSOR_KEYS = [desc.key for desc in SENSOR_TYPES] diff --git a/homeassistant/components/lookin/const.py b/homeassistant/components/lookin/const.py index 1605a169592..d9b1141aa97 100644 --- a/homeassistant/components/lookin/const.py +++ b/homeassistant/components/lookin/const.py @@ -3,8 +3,7 @@ from __future__ import annotations from typing import Final +from homeassistant.const import Platform + DOMAIN: Final = "lookin" -PLATFORMS: Final = [ - "sensor", - "climate", -] +PLATFORMS: Final = [Platform.CLIMATE, Platform.SENSOR] diff --git a/homeassistant/components/luftdaten/__init__.py b/homeassistant/components/luftdaten/__init__.py index f8a67fff2f3..63b9965243e 100644 --- a/homeassistant/components/luftdaten/__init__.py +++ b/homeassistant/components/luftdaten/__init__.py @@ -21,6 +21,7 @@ from homeassistant.const import ( PERCENTAGE, PRESSURE_PA, TEMP_CELSIUS, + Platform, ) from homeassistant.core import callback from homeassistant.exceptions import ConfigEntryNotReady @@ -38,7 +39,7 @@ DATA_LUFTDATEN_CLIENT = "data_luftdaten_client" DATA_LUFTDATEN_LISTENER = "data_luftdaten_listener" DEFAULT_ATTRIBUTION = "Data provided by luftdaten.info" -PLATFORMS = ["sensor"] +PLATFORMS = [Platform.SENSOR] SENSOR_HUMIDITY = "humidity" SENSOR_PM10 = "P1" diff --git a/homeassistant/components/lutron_caseta/__init__.py b/homeassistant/components/lutron_caseta/__init__.py index e1a93385d31..3c74e378336 100644 --- a/homeassistant/components/lutron_caseta/__init__.py +++ b/homeassistant/components/lutron_caseta/__init__.py @@ -12,7 +12,7 @@ from pylutron_caseta.smartbridge import Smartbridge import voluptuous as vol from homeassistant import config_entries -from homeassistant.const import CONF_HOST +from homeassistant.const import CONF_HOST, Platform from homeassistant.core import callback from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers import device_registry as dr @@ -63,7 +63,14 @@ CONFIG_SCHEMA = vol.Schema( extra=vol.ALLOW_EXTRA, ) -PLATFORMS = ["light", "switch", "cover", "scene", "fan", "binary_sensor"] +PLATFORMS = [ + Platform.BINARY_SENSOR, + Platform.COVER, + Platform.FAN, + Platform.LIGHT, + Platform.SCENE, + Platform.SWITCH, +] async def async_setup(hass, base_config): diff --git a/homeassistant/components/lyric/__init__.py b/homeassistant/components/lyric/__init__.py index a9d5cbdec7d..623abb54c4b 100644 --- a/homeassistant/components/lyric/__init__.py +++ b/homeassistant/components/lyric/__init__.py @@ -13,7 +13,7 @@ import async_timeout import voluptuous as vol from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET +from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET, Platform from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryAuthFailed from homeassistant.helpers import ( @@ -48,7 +48,7 @@ CONFIG_SCHEMA = vol.Schema( _LOGGER = logging.getLogger(__name__) -PLATFORMS = ["climate", "sensor"] +PLATFORMS = [Platform.CLIMATE, Platform.SENSOR] async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: