From 79cd281c482965734e36d8d299111249ba8347e2 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Sat, 4 Dec 2021 13:19:49 +0100 Subject: [PATCH] Use platform enum (5) [P-R] (#60943) --- homeassistant/components/p1_monitor/__init__.py | 5 ++--- homeassistant/components/philips_js/__init__.py | 3 ++- homeassistant/components/pi_hole/__init__.py | 7 ++++--- homeassistant/components/picnic/__init__.py | 4 ++-- homeassistant/components/plaato/const.py | 4 +++- homeassistant/components/plugwise/const.py | 10 ++++++++-- homeassistant/components/poolsense/__init__.py | 4 ++-- homeassistant/components/powerwall/__init__.py | 4 ++-- homeassistant/components/progettihwsw/__init__.py | 3 ++- homeassistant/components/prosegur/__init__.py | 4 ++-- homeassistant/components/ps4/__init__.py | 3 ++- homeassistant/components/pvpc_hourly_pricing/const.py | 4 +++- homeassistant/components/rachio/__init__.py | 4 ++-- homeassistant/components/rainforest_eagle/__init__.py | 3 ++- homeassistant/components/rainmachine/__init__.py | 3 ++- homeassistant/components/rdw/__init__.py | 5 ++--- homeassistant/components/recollect_waste/__init__.py | 3 ++- homeassistant/components/rfxtrx/__init__.py | 9 ++++++++- homeassistant/components/ridwell/__init__.py | 4 ++-- homeassistant/components/ring/__init__.py | 10 ++++++++-- .../components/rituals_perfume_genie/__init__.py | 9 ++++++++- homeassistant/components/roku/__init__.py | 6 ++---- homeassistant/components/roomba/const.py | 4 +++- homeassistant/components/rpi_power/__init__.py | 3 ++- homeassistant/components/ruckus_unleashed/const.py | 4 +++- 25 files changed, 80 insertions(+), 42 deletions(-) diff --git a/homeassistant/components/p1_monitor/__init__.py b/homeassistant/components/p1_monitor/__init__.py index 5d649fa6d63..d87c521332e 100644 --- a/homeassistant/components/p1_monitor/__init__.py +++ b/homeassistant/components/p1_monitor/__init__.py @@ -5,9 +5,8 @@ from typing import TypedDict from p1monitor import P1Monitor, Phases, Settings, SmartMeter -from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_HOST +from homeassistant.const import CONF_HOST, Platform from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers.aiohttp_client import async_get_clientsession @@ -22,7 +21,7 @@ from .const import ( SERVICE_SMARTMETER, ) -PLATFORMS = (SENSOR_DOMAIN,) +PLATFORMS = [Platform.SENSOR] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: diff --git a/homeassistant/components/philips_js/__init__.py b/homeassistant/components/philips_js/__init__.py index 79999b95d12..fe3e46c70f1 100644 --- a/homeassistant/components/philips_js/__init__.py +++ b/homeassistant/components/philips_js/__init__.py @@ -16,6 +16,7 @@ from homeassistant.const import ( CONF_HOST, CONF_PASSWORD, CONF_USERNAME, + Platform, ) from homeassistant.core import CALLBACK_TYPE, Context, HassJob, HomeAssistant, callback from homeassistant.helpers.debounce import Debouncer @@ -23,7 +24,7 @@ from homeassistant.helpers.update_coordinator import DataUpdateCoordinator from .const import CONF_ALLOW_NOTIFY, DOMAIN -PLATFORMS = ["media_player", "light", "remote"] +PLATFORMS = [Platform.MEDIA_PLAYER, Platform.LIGHT, Platform.REMOTE] LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/pi_hole/__init__.py b/homeassistant/components/pi_hole/__init__.py index 930ded4aa42..3e18953af84 100644 --- a/homeassistant/components/pi_hole/__init__.py +++ b/homeassistant/components/pi_hole/__init__.py @@ -14,6 +14,7 @@ from homeassistant.const import ( CONF_NAME, CONF_SSL, CONF_VERIFY_SSL, + Platform, ) from homeassistant.core import HomeAssistant, callback from homeassistant.exceptions import ConfigEntryNotReady @@ -150,11 +151,11 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: @callback -def _async_platforms(entry: ConfigEntry) -> list[str]: +def _async_platforms(entry: ConfigEntry) -> list[Platform]: """Return platforms to be loaded / unloaded.""" - platforms = ["binary_sensor", "sensor"] + platforms = [Platform.BINARY_SENSOR, Platform.SENSOR] if not entry.data[CONF_STATISTICS_ONLY]: - platforms.append("switch") + platforms.append(Platform.SWITCH) return platforms diff --git a/homeassistant/components/picnic/__init__.py b/homeassistant/components/picnic/__init__.py index ce6a02a81b5..e34223a4799 100644 --- a/homeassistant/components/picnic/__init__.py +++ b/homeassistant/components/picnic/__init__.py @@ -3,13 +3,13 @@ from python_picnic_api import PicnicAPI from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_ACCESS_TOKEN +from homeassistant.const import CONF_ACCESS_TOKEN, Platform from homeassistant.core import HomeAssistant from .const import CONF_API, CONF_COORDINATOR, CONF_COUNTRY_CODE, DOMAIN from .coordinator import PicnicUpdateCoordinator -PLATFORMS = ["sensor"] +PLATFORMS = [Platform.SENSOR] def create_picnic_client(entry: ConfigEntry): diff --git a/homeassistant/components/plaato/const.py b/homeassistant/components/plaato/const.py index 2d8cf40c91e..c47b91a4adb 100644 --- a/homeassistant/components/plaato/const.py +++ b/homeassistant/components/plaato/const.py @@ -1,6 +1,8 @@ """Const for Plaato.""" from datetime import timedelta +from homeassistant.const import Platform + DOMAIN = "plaato" PLAATO_DEVICE_SENSORS = "sensors" PLAATO_DEVICE_ATTRS = "attrs" @@ -15,7 +17,7 @@ PLACEHOLDER_DOCS_URL = "docs_url" PLACEHOLDER_DEVICE_TYPE = "device_type" PLACEHOLDER_DEVICE_NAME = "device_name" DOCS_URL = "https://www.home-assistant.io/integrations/plaato/" -PLATFORMS = ["sensor", "binary_sensor"] +PLATFORMS = [Platform.SENSOR, Platform.BINARY_SENSOR] SENSOR_DATA = "sensor_data" COORDINATOR = "coordinator" DEVICE = "device" diff --git a/homeassistant/components/plugwise/const.py b/homeassistant/components/plugwise/const.py index 2c1867346c4..9c6823e22e4 100644 --- a/homeassistant/components/plugwise/const.py +++ b/homeassistant/components/plugwise/const.py @@ -1,4 +1,5 @@ """Constants for Plugwise component.""" +from homeassistant.const import Platform API = "api" ATTR_ILLUMINANCE = "illuminance" @@ -20,8 +21,13 @@ STRETCH_USERNAME = "stretch" UNDO_UPDATE_LISTENER = "undo_update_listener" UNIT_LUMEN = "lm" -PLATFORMS_GATEWAY = ["binary_sensor", "climate", "sensor", "switch"] -SENSOR_PLATFORMS = ["sensor", "switch"] +PLATFORMS_GATEWAY = [ + Platform.BINARY_SENSOR, + Platform.CLIMATE, + Platform.SENSOR, + Platform.SWITCH, +] +SENSOR_PLATFORMS = [Platform.SENSOR, Platform.SWITCH] ZEROCONF_MAP = { "smile": "P1", "smile_thermo": "Anna", diff --git a/homeassistant/components/poolsense/__init__.py b/homeassistant/components/poolsense/__init__.py index 7ca7751b6f0..31362e41668 100644 --- a/homeassistant/components/poolsense/__init__.py +++ b/homeassistant/components/poolsense/__init__.py @@ -7,7 +7,7 @@ from poolsense import PoolSense from poolsense.exceptions import PoolSenseError from homeassistant.config_entries import ConfigEntry -from homeassistant.const import ATTR_ATTRIBUTION, CONF_EMAIL, CONF_PASSWORD +from homeassistant.const import ATTR_ATTRIBUTION, CONF_EMAIL, CONF_PASSWORD, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import aiohttp_client from homeassistant.helpers.entity import EntityDescription @@ -19,7 +19,7 @@ from homeassistant.helpers.update_coordinator import ( from .const import ATTRIBUTION, DOMAIN -PLATFORMS = ["sensor", "binary_sensor"] +PLATFORMS = [Platform.SENSOR, Platform.BINARY_SENSOR] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/powerwall/__init__.py b/homeassistant/components/powerwall/__init__.py index 8b06b2a9c6d..fa7b33ff2ad 100644 --- a/homeassistant/components/powerwall/__init__.py +++ b/homeassistant/components/powerwall/__init__.py @@ -11,7 +11,7 @@ from tesla_powerwall import ( ) from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_IP_ADDRESS, CONF_PASSWORD +from homeassistant.const import CONF_IP_ADDRESS, CONF_PASSWORD, Platform from homeassistant.core import HomeAssistant, callback from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady from homeassistant.helpers import entity_registry @@ -38,7 +38,7 @@ from .const import ( CONFIG_SCHEMA = cv.deprecated(DOMAIN) -PLATFORMS = ["binary_sensor", "sensor"] +PLATFORMS = [Platform.BINARY_SENSOR, Platform.SENSOR] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/progettihwsw/__init__.py b/homeassistant/components/progettihwsw/__init__.py index e3555079a4d..1ebabd5bb08 100644 --- a/homeassistant/components/progettihwsw/__init__.py +++ b/homeassistant/components/progettihwsw/__init__.py @@ -5,11 +5,12 @@ from ProgettiHWSW.input import Input from ProgettiHWSW.relay import Relay from homeassistant.config_entries import ConfigEntry +from homeassistant.const import Platform from homeassistant.core import HomeAssistant from .const import DOMAIN -PLATFORMS = ["switch", "binary_sensor"] +PLATFORMS = [Platform.SWITCH, Platform.BINARY_SENSOR] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: diff --git a/homeassistant/components/prosegur/__init__.py b/homeassistant/components/prosegur/__init__.py index 3e31a1142ce..b8023c7fadd 100644 --- a/homeassistant/components/prosegur/__init__.py +++ b/homeassistant/components/prosegur/__init__.py @@ -4,14 +4,14 @@ import logging from pyprosegur.auth import Auth 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.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady from homeassistant.helpers import aiohttp_client from .const import CONF_COUNTRY, DOMAIN -PLATFORMS = ["alarm_control_panel"] +PLATFORMS = [Platform.ALARM_CONTROL_PANEL] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/ps4/__init__.py b/homeassistant/components/ps4/__init__.py index bf5eafa7bbb..caab9e1dd26 100644 --- a/homeassistant/components/ps4/__init__.py +++ b/homeassistant/components/ps4/__init__.py @@ -17,6 +17,7 @@ from homeassistant.const import ( ATTR_LOCKED, CONF_REGION, CONF_TOKEN, + Platform, ) from homeassistant.core import HomeAssistant, split_entity_id from homeassistant.exceptions import HomeAssistantError @@ -45,7 +46,7 @@ PS4_COMMAND_SCHEMA = vol.Schema( } ) -PLATFORMS = ["media_player"] +PLATFORMS = [Platform.MEDIA_PLAYER] class PS4Data: diff --git a/homeassistant/components/pvpc_hourly_pricing/const.py b/homeassistant/components/pvpc_hourly_pricing/const.py index ad97124c330..186ee1171f3 100644 --- a/homeassistant/components/pvpc_hourly_pricing/const.py +++ b/homeassistant/components/pvpc_hourly_pricing/const.py @@ -1,6 +1,8 @@ """Constant values for pvpc_hourly_pricing.""" +from homeassistant.const import Platform + DOMAIN = "pvpc_hourly_pricing" -PLATFORMS = ["sensor"] +PLATFORMS = [Platform.SENSOR] ATTR_POWER = "power" ATTR_POWER_P3 = "power_p3" ATTR_TARIFF = "tariff" diff --git a/homeassistant/components/rachio/__init__.py b/homeassistant/components/rachio/__init__.py index 2d1caf23c42..134a10795f2 100644 --- a/homeassistant/components/rachio/__init__.py +++ b/homeassistant/components/rachio/__init__.py @@ -6,7 +6,7 @@ from rachiopy import Rachio from requests.exceptions import ConnectTimeout from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_API_KEY +from homeassistant.const import CONF_API_KEY, Platform from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers import config_validation as cv @@ -20,7 +20,7 @@ from .webhooks import ( _LOGGER = logging.getLogger(__name__) -PLATFORMS = ["switch", "binary_sensor"] +PLATFORMS = [Platform.SWITCH, Platform.BINARY_SENSOR] CONFIG_SCHEMA = cv.deprecated(DOMAIN) diff --git a/homeassistant/components/rainforest_eagle/__init__.py b/homeassistant/components/rainforest_eagle/__init__.py index 44a5624267e..862c9850cb9 100644 --- a/homeassistant/components/rainforest_eagle/__init__.py +++ b/homeassistant/components/rainforest_eagle/__init__.py @@ -2,12 +2,13 @@ from __future__ import annotations from homeassistant.config_entries import ConfigEntry +from homeassistant.const import Platform from homeassistant.core import HomeAssistant from . import data from .const import DOMAIN -PLATFORMS = ("sensor",) +PLATFORMS = [Platform.SENSOR] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: diff --git a/homeassistant/components/rainmachine/__init__.py b/homeassistant/components/rainmachine/__init__.py index 9f7f014f13d..0e0dd726f75 100644 --- a/homeassistant/components/rainmachine/__init__.py +++ b/homeassistant/components/rainmachine/__init__.py @@ -18,6 +18,7 @@ from homeassistant.const import ( CONF_PASSWORD, CONF_PORT, CONF_SSL, + Platform, ) from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassistant.exceptions import ConfigEntryNotReady @@ -56,7 +57,7 @@ DEFAULT_UPDATE_INTERVAL = timedelta(seconds=15) CONFIG_SCHEMA = cv.deprecated(DOMAIN) -PLATFORMS = ["binary_sensor", "sensor", "switch"] +PLATFORMS = [Platform.BINARY_SENSOR, Platform.SENSOR, Platform.SWITCH] UPDATE_INTERVALS = { DATA_PROVISION_SETTINGS: timedelta(minutes=1), diff --git a/homeassistant/components/rdw/__init__.py b/homeassistant/components/rdw/__init__.py index bde83fffad3..ac2bed06310 100644 --- a/homeassistant/components/rdw/__init__.py +++ b/homeassistant/components/rdw/__init__.py @@ -3,16 +3,15 @@ from __future__ import annotations from vehicle import RDW, Vehicle -from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN -from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.config_entries import ConfigEntry +from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers.aiohttp_client import async_get_clientsession from homeassistant.helpers.update_coordinator import DataUpdateCoordinator from .const import CONF_LICENSE_PLATE, DOMAIN, LOGGER, SCAN_INTERVAL -PLATFORMS = (BINARY_SENSOR_DOMAIN, SENSOR_DOMAIN) +PLATFORMS = [Platform.BINARY_SENSOR, Platform.SENSOR] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: diff --git a/homeassistant/components/recollect_waste/__init__.py b/homeassistant/components/recollect_waste/__init__.py index 25900345205..23ebf8aefbc 100644 --- a/homeassistant/components/recollect_waste/__init__.py +++ b/homeassistant/components/recollect_waste/__init__.py @@ -7,6 +7,7 @@ from aiorecollect.client import Client, PickupEvent from aiorecollect.errors import RecollectError from homeassistant.config_entries import ConfigEntry +from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import aiohttp_client from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed @@ -16,7 +17,7 @@ from .const import CONF_PLACE_ID, CONF_SERVICE_ID, DOMAIN, LOGGER DEFAULT_NAME = "recollect_waste" DEFAULT_UPDATE_INTERVAL = timedelta(days=1) -PLATFORMS = ["sensor"] +PLATFORMS = [Platform.SENSOR] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: diff --git a/homeassistant/components/rfxtrx/__init__.py b/homeassistant/components/rfxtrx/__init__.py index d7de0f5b7be..7fc743d021f 100644 --- a/homeassistant/components/rfxtrx/__init__.py +++ b/homeassistant/components/rfxtrx/__init__.py @@ -18,6 +18,7 @@ from homeassistant.const import ( CONF_HOST, CONF_PORT, EVENT_HOMEASSISTANT_STOP, + Platform, ) from homeassistant.core import callback import homeassistant.helpers.config_validation as cv @@ -60,7 +61,13 @@ def _bytearray_string(data): SERVICE_SEND_SCHEMA = vol.Schema({ATTR_EVENT: _bytearray_string}) -PLATFORMS = ["switch", "sensor", "light", "binary_sensor", "cover"] +PLATFORMS = [ + Platform.SWITCH, + Platform.SENSOR, + Platform.LIGHT, + Platform.BINARY_SENSOR, + Platform.COVER, +] async def async_setup_entry(hass, entry: config_entries.ConfigEntry): diff --git a/homeassistant/components/ridwell/__init__.py b/homeassistant/components/ridwell/__init__.py index 4aa5ea3e162..85d456271df 100644 --- a/homeassistant/components/ridwell/__init__.py +++ b/homeassistant/components/ridwell/__init__.py @@ -9,7 +9,7 @@ from aioridwell.client import RidwellAccount, RidwellPickupEvent from aioridwell.errors import InvalidCredentialsError, RidwellError 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.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady from homeassistant.helpers import aiohttp_client @@ -19,7 +19,7 @@ from .const import DATA_ACCOUNT, DATA_COORDINATOR, DOMAIN, LOGGER DEFAULT_UPDATE_INTERVAL = timedelta(hours=1) -PLATFORMS: list[str] = ["sensor"] +PLATFORMS: list[Platform] = [Platform.SENSOR] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: diff --git a/homeassistant/components/ring/__init__.py b/homeassistant/components/ring/__init__.py index a8196b30302..db383b9228f 100644 --- a/homeassistant/components/ring/__init__.py +++ b/homeassistant/components/ring/__init__.py @@ -11,7 +11,7 @@ from oauthlib.oauth2 import AccessDeniedError import requests from ring_doorbell import Auth, Ring -from homeassistant.const import __version__ +from homeassistant.const import Platform, __version__ from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.event import async_track_time_interval from homeassistant.util.async_ import run_callback_threadsafe @@ -26,7 +26,13 @@ NOTIFICATION_TITLE = "Ring Setup" DOMAIN = "ring" DEFAULT_ENTITY_NAMESPACE = "ring" -PLATFORMS = ("binary_sensor", "light", "sensor", "switch", "camera") +PLATFORMS = [ + Platform.BINARY_SENSOR, + Platform.LIGHT, + Platform.SENSOR, + Platform.SWITCH, + Platform.CAMERA, +] async def async_setup(hass, config): diff --git a/homeassistant/components/rituals_perfume_genie/__init__.py b/homeassistant/components/rituals_perfume_genie/__init__.py index 8a9ed5d94a3..c45a762ca9a 100644 --- a/homeassistant/components/rituals_perfume_genie/__init__.py +++ b/homeassistant/components/rituals_perfume_genie/__init__.py @@ -6,6 +6,7 @@ import aiohttp from pyrituals import Account, Diffuser from homeassistant.config_entries import ConfigEntry +from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers.aiohttp_client import async_get_clientsession @@ -13,7 +14,13 @@ from homeassistant.helpers.update_coordinator import DataUpdateCoordinator from .const import ACCOUNT_HASH, COORDINATORS, DEVICES, DOMAIN -PLATFORMS = ["binary_sensor", "number", "select", "sensor", "switch"] +PLATFORMS = [ + Platform.BINARY_SENSOR, + Platform.NUMBER, + Platform.SELECT, + Platform.SENSOR, + Platform.SWITCH, +] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/roku/__init__.py b/homeassistant/components/roku/__init__.py index f1c30ec2af7..b145864b726 100644 --- a/homeassistant/components/roku/__init__.py +++ b/homeassistant/components/roku/__init__.py @@ -5,10 +5,8 @@ import logging from rokuecp import RokuConnectionError, RokuError -from homeassistant.components.media_player import DOMAIN as MEDIA_PLAYER_DOMAIN -from homeassistant.components.remote import DOMAIN as REMOTE_DOMAIN from homeassistant.config_entries import ConfigEntry -from homeassistant.const import CONF_HOST +from homeassistant.const import CONF_HOST, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import config_validation as cv @@ -17,7 +15,7 @@ from .coordinator import RokuDataUpdateCoordinator CONFIG_SCHEMA = cv.deprecated(DOMAIN) -PLATFORMS = [MEDIA_PLAYER_DOMAIN, REMOTE_DOMAIN] +PLATFORMS = [Platform.MEDIA_PLAYER, Platform.REMOTE] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/roomba/const.py b/homeassistant/components/roomba/const.py index 2e59279cfdb..ae872e0540c 100644 --- a/homeassistant/components/roomba/const.py +++ b/homeassistant/components/roomba/const.py @@ -1,6 +1,8 @@ """The roomba constants.""" +from homeassistant.const import Platform + DOMAIN = "roomba" -PLATFORMS = ["sensor", "binary_sensor", "vacuum"] +PLATFORMS = [Platform.SENSOR, Platform.BINARY_SENSOR, Platform.VACUUM] CONF_CERT = "certificate" CONF_CONTINUOUS = "continuous" CONF_BLID = "blid" diff --git a/homeassistant/components/rpi_power/__init__.py b/homeassistant/components/rpi_power/__init__.py index 320043a0260..8647ab38a78 100644 --- a/homeassistant/components/rpi_power/__init__.py +++ b/homeassistant/components/rpi_power/__init__.py @@ -1,8 +1,9 @@ """The Raspberry Pi Power Supply Checker integration.""" from homeassistant.config_entries import ConfigEntry +from homeassistant.const import Platform from homeassistant.core import HomeAssistant -PLATFORMS = ["binary_sensor"] +PLATFORMS = [Platform.BINARY_SENSOR] async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: diff --git a/homeassistant/components/ruckus_unleashed/const.py b/homeassistant/components/ruckus_unleashed/const.py index 77e1029143e..e6087be3fd2 100644 --- a/homeassistant/components/ruckus_unleashed/const.py +++ b/homeassistant/components/ruckus_unleashed/const.py @@ -1,6 +1,8 @@ """Constants for the Ruckus Unleashed integration.""" +from homeassistant.const import Platform + DOMAIN = "ruckus_unleashed" -PLATFORMS = ["device_tracker"] +PLATFORMS = [Platform.DEVICE_TRACKER] SCAN_INTERVAL = 180 MANUFACTURER = "Ruckus"