diff --git a/homeassistant/auth/permissions/const.py b/homeassistant/auth/permissions/const.py index e6c44036a7e..2a49971954e 100644 --- a/homeassistant/auth/permissions/const.py +++ b/homeassistant/auth/permissions/const.py @@ -1,4 +1,5 @@ """Permission constants.""" + CAT_ENTITIES = "entities" CAT_CONFIG_ENTRIES = "config_entries" SUBCAT_ALL = "all" diff --git a/homeassistant/components/advantage_air/const.py b/homeassistant/components/advantage_air/const.py index 80ce9b6eaa1..6ae0a0e06d5 100644 --- a/homeassistant/components/advantage_air/const.py +++ b/homeassistant/components/advantage_air/const.py @@ -1,4 +1,5 @@ """Constants used by Advantage Air integration.""" + DOMAIN = "advantage_air" ADVANTAGE_AIR_RETRY = 10 ADVANTAGE_AIR_STATE_OPEN = "open" diff --git a/homeassistant/components/agent_dvr/const.py b/homeassistant/components/agent_dvr/const.py index e571edf9800..cd0284ca87c 100644 --- a/homeassistant/components/agent_dvr/const.py +++ b/homeassistant/components/agent_dvr/const.py @@ -1,4 +1,5 @@ """Constants for agent_dvr component.""" + DOMAIN = "agent_dvr" SERVERS = "servers" DEVICES = "devices" diff --git a/homeassistant/components/air_quality/group.py b/homeassistant/components/air_quality/group.py index 2ac081496cd..162457d336f 100644 --- a/homeassistant/components/air_quality/group.py +++ b/homeassistant/components/air_quality/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/airnow/const.py b/homeassistant/components/airnow/const.py index 137c8f1efad..c61136b3eeb 100644 --- a/homeassistant/components/airnow/const.py +++ b/homeassistant/components/airnow/const.py @@ -1,4 +1,5 @@ """Constants for the AirNow integration.""" + ATTR_API_AQI = "AQI" ATTR_API_AQI_LEVEL = "Category.Number" ATTR_API_AQI_DESCRIPTION = "Category.Name" diff --git a/homeassistant/components/alarm_control_panel/group.py b/homeassistant/components/alarm_control_panel/group.py index dabe49069d5..69a5e6d367e 100644 --- a/homeassistant/components/alarm_control_panel/group.py +++ b/homeassistant/components/alarm_control_panel/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import ( STATE_ALARM_ARMED_AWAY, diff --git a/homeassistant/components/alexa/resources.py b/homeassistant/components/alexa/resources.py index 3606c5401ee..b75e5597b6f 100644 --- a/homeassistant/components/alexa/resources.py +++ b/homeassistant/components/alexa/resources.py @@ -1,6 +1,5 @@ """Alexa Resources and Assets.""" - from typing import Any diff --git a/homeassistant/components/amberelectric/sensor.py b/homeassistant/components/amberelectric/sensor.py index 547b51a0f67..aafdd730a0c 100644 --- a/homeassistant/components/amberelectric/sensor.py +++ b/homeassistant/components/amberelectric/sensor.py @@ -4,7 +4,6 @@ # Current and forecast will create general, controlled load and feed in as required # At the moment renewables in the only grid sensor. - from __future__ import annotations from typing import Any diff --git a/homeassistant/components/amcrest/const.py b/homeassistant/components/amcrest/const.py index 6c2fe431d43..377c5642b4b 100644 --- a/homeassistant/components/amcrest/const.py +++ b/homeassistant/components/amcrest/const.py @@ -1,4 +1,5 @@ """Constants for amcrest component.""" + DOMAIN = "amcrest" DATA_AMCREST = DOMAIN CAMERAS = "cameras" diff --git a/homeassistant/components/androidtv/const.py b/homeassistant/components/androidtv/const.py index 17936421680..fb43e0af090 100644 --- a/homeassistant/components/androidtv/const.py +++ b/homeassistant/components/androidtv/const.py @@ -1,4 +1,5 @@ """Android Debug Bridge component constants.""" + DOMAIN = "androidtv" ANDROID_DEV = DOMAIN diff --git a/homeassistant/components/anthemav/const.py b/homeassistant/components/anthemav/const.py index 7cf586fb05d..8bcdd013a63 100644 --- a/homeassistant/components/anthemav/const.py +++ b/homeassistant/components/anthemav/const.py @@ -1,4 +1,5 @@ """Constants for the Anthem A/V Receivers integration.""" + ANTHEMAV_UPDATE_SIGNAL = "anthemav_update" DEFAULT_NAME = "Anthem AV" diff --git a/homeassistant/components/arcam_fmj/const.py b/homeassistant/components/arcam_fmj/const.py index e3c5ae3075a..94e8f5a9ee1 100644 --- a/homeassistant/components/arcam_fmj/const.py +++ b/homeassistant/components/arcam_fmj/const.py @@ -1,4 +1,5 @@ """Constants used for arcam.""" + DOMAIN = "arcam_fmj" SIGNAL_CLIENT_STARTED = "arcam.client_started" diff --git a/homeassistant/components/assist_pipeline/const.py b/homeassistant/components/assist_pipeline/const.py index ef1ed1177a6..3463d94fb84 100644 --- a/homeassistant/components/assist_pipeline/const.py +++ b/homeassistant/components/assist_pipeline/const.py @@ -1,4 +1,5 @@ """Constants for the Assist pipeline integration.""" + DOMAIN = "assist_pipeline" DATA_CONFIG = f"{DOMAIN}.config" diff --git a/homeassistant/components/asuswrt/const.py b/homeassistant/components/asuswrt/const.py index a60046b50c2..d31d986574e 100644 --- a/homeassistant/components/asuswrt/const.py +++ b/homeassistant/components/asuswrt/const.py @@ -1,4 +1,5 @@ """AsusWrt component constants.""" + DOMAIN = "asuswrt" CONF_DNSMASQ = "dnsmasq" diff --git a/homeassistant/components/aussie_broadband/const.py b/homeassistant/components/aussie_broadband/const.py index 5747ee86fea..ad19b7d8a27 100644 --- a/homeassistant/components/aussie_broadband/const.py +++ b/homeassistant/components/aussie_broadband/const.py @@ -1,4 +1,5 @@ """Constants for the Aussie Broadband integration.""" + DEFAULT_UPDATE_INTERVAL = 30 DOMAIN = "aussie_broadband" SERVICE_ID = "service_id" diff --git a/homeassistant/components/aws/const.py b/homeassistant/components/aws/const.py index 8be6afec7ff..c885495934f 100644 --- a/homeassistant/components/aws/const.py +++ b/homeassistant/components/aws/const.py @@ -1,4 +1,5 @@ """Constant for AWS component.""" + DOMAIN = "aws" DATA_CONFIG = "aws_config" diff --git a/homeassistant/components/azure_devops/const.py b/homeassistant/components/azure_devops/const.py index adaf5ebe767..a5bbe9dac54 100644 --- a/homeassistant/components/azure_devops/const.py +++ b/homeassistant/components/azure_devops/const.py @@ -1,4 +1,5 @@ """Constants for the Azure DevOps integration.""" + DOMAIN = "azure_devops" CONF_ORG = "organization" diff --git a/homeassistant/components/balboa/const.py b/homeassistant/components/balboa/const.py index 23189a4d7e9..1536959f8be 100644 --- a/homeassistant/components/balboa/const.py +++ b/homeassistant/components/balboa/const.py @@ -1,4 +1,5 @@ """Constants for the Balboa Spa Client integration.""" + DOMAIN = "balboa" CONF_SYNC_TIME = "sync_time" DEFAULT_SYNC_TIME = False diff --git a/homeassistant/components/binary_sensor/group.py b/homeassistant/components/binary_sensor/group.py index 234883ffd5a..e1a0b18dd08 100644 --- a/homeassistant/components/binary_sensor/group.py +++ b/homeassistant/components/binary_sensor/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/blackbird/const.py b/homeassistant/components/blackbird/const.py index aa8d7e7d514..27a4f1dcffb 100644 --- a/homeassistant/components/blackbird/const.py +++ b/homeassistant/components/blackbird/const.py @@ -1,3 +1,4 @@ """Constants for the Monoprice Blackbird Matrix Switch component.""" + DOMAIN = "blackbird" SERVICE_SETALLZONES = "set_all_zones" diff --git a/homeassistant/components/blebox/const.py b/homeassistant/components/blebox/const.py index 533c33f37bb..ff6a6b33af6 100644 --- a/homeassistant/components/blebox/const.py +++ b/homeassistant/components/blebox/const.py @@ -1,6 +1,5 @@ """Constants for the BleBox devices integration.""" - DOMAIN = "blebox" PRODUCT = "product" diff --git a/homeassistant/components/blueprint/const.py b/homeassistant/components/blueprint/const.py index 1ca6117f153..18433aa6ba6 100644 --- a/homeassistant/components/blueprint/const.py +++ b/homeassistant/components/blueprint/const.py @@ -1,4 +1,5 @@ """Constants for the blueprint integration.""" + BLUEPRINT_FOLDER = "blueprints" CONF_BLUEPRINT = "blueprint" diff --git a/homeassistant/components/bluesound/const.py b/homeassistant/components/bluesound/const.py index af1a8e5187c..ae5291c6513 100644 --- a/homeassistant/components/bluesound/const.py +++ b/homeassistant/components/bluesound/const.py @@ -1,4 +1,5 @@ """Constants for the Bluesound HiFi wireless speakers and audio integrations component.""" + DOMAIN = "bluesound" SERVICE_CLEAR_TIMER = "clear_sleep_timer" SERVICE_JOIN = "join" diff --git a/homeassistant/components/caldav/api.py b/homeassistant/components/caldav/api.py index 3b524e29370..a48336331ca 100644 --- a/homeassistant/components/caldav/api.py +++ b/homeassistant/components/caldav/api.py @@ -1,6 +1,5 @@ """Library for working with CalDAV api.""" - import caldav from homeassistant.core import HomeAssistant diff --git a/homeassistant/components/channels/const.py b/homeassistant/components/channels/const.py index 5ae7fdebb0b..d05848d40f4 100644 --- a/homeassistant/components/channels/const.py +++ b/homeassistant/components/channels/const.py @@ -1,4 +1,5 @@ """Constants for the Channels component.""" + DOMAIN = "channels" SERVICE_SEEK_FORWARD = "seek_forward" SERVICE_SEEK_BACKWARD = "seek_backward" diff --git a/homeassistant/components/climate/group.py b/homeassistant/components/climate/group.py index cec41f81b28..45d6a9b5fcb 100644 --- a/homeassistant/components/climate/group.py +++ b/homeassistant/components/climate/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import STATE_OFF from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/co2signal/const.py b/homeassistant/components/co2signal/const.py index b025c655ce6..34ddbdc05e5 100644 --- a/homeassistant/components/co2signal/const.py +++ b/homeassistant/components/co2signal/const.py @@ -1,5 +1,4 @@ """Constants for the Co2signal integration.""" - DOMAIN = "co2signal" ATTRIBUTION = "Data provided by Electricity Maps" diff --git a/homeassistant/components/color_extractor/const.py b/homeassistant/components/color_extractor/const.py index e783dcb533d..25c15ed9dc0 100644 --- a/homeassistant/components/color_extractor/const.py +++ b/homeassistant/components/color_extractor/const.py @@ -1,4 +1,5 @@ """Constants for the color_extractor component.""" + ATTR_PATH = "color_extract_path" ATTR_URL = "color_extract_url" diff --git a/homeassistant/components/comelit/__init__.py b/homeassistant/components/comelit/__init__.py index 2cf7a145eee..478be85c1d4 100644 --- a/homeassistant/components/comelit/__init__.py +++ b/homeassistant/components/comelit/__init__.py @@ -1,6 +1,5 @@ """Comelit integration.""" - from aiocomelit.const import BRIDGE from homeassistant.config_entries import ConfigEntry diff --git a/homeassistant/components/compensation/const.py b/homeassistant/components/compensation/const.py index d49a6982166..ce959469700 100644 --- a/homeassistant/components/compensation/const.py +++ b/homeassistant/components/compensation/const.py @@ -1,4 +1,5 @@ """Compensation constants.""" + DOMAIN = "compensation" SENSOR = "compensation" diff --git a/homeassistant/components/cover/group.py b/homeassistant/components/cover/group.py index 28a1dc530fe..78335286d10 100644 --- a/homeassistant/components/cover/group.py +++ b/homeassistant/components/cover/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import STATE_CLOSED, STATE_OPEN from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/cover/intent.py b/homeassistant/components/cover/intent.py index dc8f722c7ed..a77bfbcbd16 100644 --- a/homeassistant/components/cover/intent.py +++ b/homeassistant/components/cover/intent.py @@ -1,6 +1,5 @@ """Intents for the cover integration.""" - from homeassistant.const import SERVICE_CLOSE_COVER, SERVICE_OPEN_COVER from homeassistant.core import HomeAssistant from homeassistant.helpers import intent diff --git a/homeassistant/components/daikin/const.py b/homeassistant/components/daikin/const.py index 67d014ecdb3..690267e5c83 100644 --- a/homeassistant/components/daikin/const.py +++ b/homeassistant/components/daikin/const.py @@ -1,4 +1,5 @@ """Constants for Daikin.""" + DOMAIN = "daikin" ATTR_TARGET_TEMPERATURE = "target_temperature" diff --git a/homeassistant/components/demo/const.py b/homeassistant/components/demo/const.py index e11b0b0731a..cd964af5f3d 100644 --- a/homeassistant/components/demo/const.py +++ b/homeassistant/components/demo/const.py @@ -1,3 +1,4 @@ """Constants for the Demo component.""" + DOMAIN = "demo" SERVICE_RANDOMIZE_DEVICE_TRACKER_DATA = "randomize_device_tracker_data" diff --git a/homeassistant/components/device_automation/const.py b/homeassistant/components/device_automation/const.py index 2970e5e79b2..5cbc0378c41 100644 --- a/homeassistant/components/device_automation/const.py +++ b/homeassistant/components/device_automation/const.py @@ -1,4 +1,5 @@ """Constants for device automations.""" + CONF_CHANGED_STATES = "changed_states" CONF_IS_OFF = "is_off" CONF_IS_ON = "is_on" diff --git a/homeassistant/components/device_tracker/group.py b/homeassistant/components/device_tracker/group.py index 9bd2c991678..97e9556eaeb 100644 --- a/homeassistant/components/device_tracker/group.py +++ b/homeassistant/components/device_tracker/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import STATE_HOME, STATE_NOT_HOME from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/directv/const.py b/homeassistant/components/directv/const.py index e90fd6879c7..fe9aba3b4f4 100644 --- a/homeassistant/components/directv/const.py +++ b/homeassistant/components/directv/const.py @@ -1,4 +1,5 @@ """Constants for the DirecTV integration.""" + DOMAIN = "directv" # Attributes diff --git a/homeassistant/components/doorbird/entity.py b/homeassistant/components/doorbird/entity.py index 4360a8ff490..f09ef54d5ac 100644 --- a/homeassistant/components/doorbird/entity.py +++ b/homeassistant/components/doorbird/entity.py @@ -1,6 +1,5 @@ """The DoorBird integration base entity.""" - from homeassistant.helpers import device_registry as dr from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity import Entity diff --git a/homeassistant/components/ecoforest/coordinator.py b/homeassistant/components/ecoforest/coordinator.py index b44ccc850ce..ae0b353a1df 100644 --- a/homeassistant/components/ecoforest/coordinator.py +++ b/homeassistant/components/ecoforest/coordinator.py @@ -1,6 +1,5 @@ """The ecoforest coordinator.""" - import logging from pyecoforest.api import EcoforestApi diff --git a/homeassistant/components/emulated_roku/const.py b/homeassistant/components/emulated_roku/const.py index 6c780367188..b8a70596048 100644 --- a/homeassistant/components/emulated_roku/const.py +++ b/homeassistant/components/emulated_roku/const.py @@ -1,4 +1,5 @@ """Constants for the emulated_roku component.""" + DOMAIN = "emulated_roku" CONF_SERVERS = "servers" diff --git a/homeassistant/components/enigma2/const.py b/homeassistant/components/enigma2/const.py index 0511a794172..277efad50eb 100644 --- a/homeassistant/components/enigma2/const.py +++ b/homeassistant/components/enigma2/const.py @@ -1,4 +1,5 @@ """Constants for the Enigma2 platform.""" + DOMAIN = "enigma2" CONF_USE_CHANNEL_ICON = "use_channel_icon" diff --git a/homeassistant/components/evohome/const.py b/homeassistant/components/evohome/const.py index 6bd3a59c225..1347c1f797c 100644 --- a/homeassistant/components/evohome/const.py +++ b/homeassistant/components/evohome/const.py @@ -1,4 +1,5 @@ """Support for (EMEA/EU-based) Honeywell TCC climate systems.""" + DOMAIN = "evohome" STORAGE_VER = 1 diff --git a/homeassistant/components/fan/group.py b/homeassistant/components/fan/group.py index 234883ffd5a..e1a0b18dd08 100644 --- a/homeassistant/components/fan/group.py +++ b/homeassistant/components/fan/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/fitbit/__init__.py b/homeassistant/components/fitbit/__init__.py index 40ea9fb1152..22d0e302d63 100644 --- a/homeassistant/components/fitbit/__init__.py +++ b/homeassistant/components/fitbit/__init__.py @@ -1,6 +1,5 @@ """The fitbit component.""" - from homeassistant.config_entries import ConfigEntry from homeassistant.const import Platform from homeassistant.core import HomeAssistant diff --git a/homeassistant/components/frontier_silicon/const.py b/homeassistant/components/frontier_silicon/const.py index 94f4e09a35a..ce0126aa803 100644 --- a/homeassistant/components/frontier_silicon/const.py +++ b/homeassistant/components/frontier_silicon/const.py @@ -1,4 +1,5 @@ """Constants for the Frontier Silicon Media Player integration.""" + DOMAIN = "frontier_silicon" CONF_WEBFSAPI_URL = "webfsapi_url" diff --git a/homeassistant/components/google_travel_time/const.py b/homeassistant/components/google_travel_time/const.py index 041858d948f..7e086640e2b 100644 --- a/homeassistant/components/google_travel_time/const.py +++ b/homeassistant/components/google_travel_time/const.py @@ -1,4 +1,5 @@ """Constants for Google Travel Time.""" + DOMAIN = "google_travel_time" ATTRIBUTION = "Powered by Google" diff --git a/homeassistant/components/html5/const.py b/homeassistant/components/html5/const.py index 1d0689511b2..bf7eaca7e24 100644 --- a/homeassistant/components/html5/const.py +++ b/homeassistant/components/html5/const.py @@ -1,3 +1,4 @@ """Constants for the HTML5 component.""" + DOMAIN = "html5" SERVICE_DISMISS = "dismiss" diff --git a/homeassistant/components/humidifier/group.py b/homeassistant/components/humidifier/group.py index 234883ffd5a..e1a0b18dd08 100644 --- a/homeassistant/components/humidifier/group.py +++ b/homeassistant/components/humidifier/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/hunterdouglas_powerview/const.py b/homeassistant/components/hunterdouglas_powerview/const.py index a2d18c6f512..ec55d413416 100644 --- a/homeassistant/components/hunterdouglas_powerview/const.py +++ b/homeassistant/components/hunterdouglas_powerview/const.py @@ -1,6 +1,5 @@ """Constants for Hunter Douglas Powerview hub.""" - from aiohttp.client_exceptions import ServerDisconnectedError from aiopvapi.helpers.aiorequest import ( PvApiConnectionError, diff --git a/homeassistant/components/hydrawise/__init__.py b/homeassistant/components/hydrawise/__init__.py index 9f44d47ecf6..541d4211e49 100644 --- a/homeassistant/components/hydrawise/__init__.py +++ b/homeassistant/components/hydrawise/__init__.py @@ -1,6 +1,5 @@ """Support for Hydrawise cloud.""" - from pydrawise import legacy import voluptuous as vol diff --git a/homeassistant/components/idasen_desk/const.py b/homeassistant/components/idasen_desk/const.py index 0d37d77307b..26d673dde37 100644 --- a/homeassistant/components/idasen_desk/const.py +++ b/homeassistant/components/idasen_desk/const.py @@ -1,6 +1,5 @@ """Constants for the Idasen Desk integration.""" - DOMAIN = "idasen_desk" EXPECTED_SERVICE_UUID = "99fa0001-338a-1024-8a49-009c0215f78a" diff --git a/homeassistant/components/justnimbus/const.py b/homeassistant/components/justnimbus/const.py index 11a4ae487c4..cf2d099becd 100644 --- a/homeassistant/components/justnimbus/const.py +++ b/homeassistant/components/justnimbus/const.py @@ -1,6 +1,5 @@ """Constants for the JustNimbus integration.""" - from typing import Final from homeassistant.const import Platform diff --git a/homeassistant/components/keymitt_ble/const.py b/homeassistant/components/keymitt_ble/const.py index a10e7124226..9d4be4fa278 100644 --- a/homeassistant/components/keymitt_ble/const.py +++ b/homeassistant/components/keymitt_ble/const.py @@ -1,4 +1,5 @@ """Constants for Keymitt BLE.""" + # Base component constants DOMAIN = "keymitt_ble" MANUFACTURER = "Naran/Keymitt" diff --git a/homeassistant/components/kodi/const.py b/homeassistant/components/kodi/const.py index 8f0ae5de737..479b02e0fb5 100644 --- a/homeassistant/components/kodi/const.py +++ b/homeassistant/components/kodi/const.py @@ -1,4 +1,5 @@ """Constants for the Kodi platform.""" + DOMAIN = "kodi" CONF_WS_PORT = "ws_port" diff --git a/homeassistant/components/kostal_plenticore/const.py b/homeassistant/components/kostal_plenticore/const.py index c0e897e6131..668b10e6971 100644 --- a/homeassistant/components/kostal_plenticore/const.py +++ b/homeassistant/components/kostal_plenticore/const.py @@ -1,2 +1,3 @@ """Constants for the Kostal Plenticore Solar Inverter integration.""" + DOMAIN = "kostal_plenticore" diff --git a/homeassistant/components/kulersky/const.py b/homeassistant/components/kulersky/const.py index 8b314d7bde9..8d0b4380bb3 100644 --- a/homeassistant/components/kulersky/const.py +++ b/homeassistant/components/kulersky/const.py @@ -1,4 +1,5 @@ """Constants for the Kuler Sky integration.""" + DOMAIN = "kulersky" DATA_ADDRESSES = "addresses" diff --git a/homeassistant/components/lamarzocco/diagnostics.py b/homeassistant/components/lamarzocco/diagnostics.py index 6e75152bd60..648d1357a35 100644 --- a/homeassistant/components/lamarzocco/diagnostics.py +++ b/homeassistant/components/lamarzocco/diagnostics.py @@ -1,6 +1,5 @@ """Diagnostics support for La Marzocco.""" - from __future__ import annotations from typing import Any diff --git a/homeassistant/components/ld2410_ble/binary_sensor.py b/homeassistant/components/ld2410_ble/binary_sensor.py index cca87de7a60..c52bc34b699 100644 --- a/homeassistant/components/ld2410_ble/binary_sensor.py +++ b/homeassistant/components/ld2410_ble/binary_sensor.py @@ -1,6 +1,5 @@ """LD2410 BLE integration binary sensor platform.""" - from homeassistant.components.binary_sensor import ( BinarySensorDeviceClass, BinarySensorEntity, diff --git a/homeassistant/components/ld2410_ble/sensor.py b/homeassistant/components/ld2410_ble/sensor.py index 5bd4a0d4d2d..933a2151a17 100644 --- a/homeassistant/components/ld2410_ble/sensor.py +++ b/homeassistant/components/ld2410_ble/sensor.py @@ -1,6 +1,5 @@ """LD2410 BLE integration sensor platform.""" - from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, diff --git a/homeassistant/components/lg_netcast/const.py b/homeassistant/components/lg_netcast/const.py index 6cb44a5a3f8..0344ad6f177 100644 --- a/homeassistant/components/lg_netcast/const.py +++ b/homeassistant/components/lg_netcast/const.py @@ -1,2 +1,3 @@ """Constants for the lg_netcast component.""" + DOMAIN = "lg_netcast" diff --git a/homeassistant/components/lg_soundbar/const.py b/homeassistant/components/lg_soundbar/const.py index c71e43c0d60..2ac0602568b 100644 --- a/homeassistant/components/lg_soundbar/const.py +++ b/homeassistant/components/lg_soundbar/const.py @@ -1,4 +1,5 @@ """Constants for the LG Soundbar integration.""" + DOMAIN = "lg_soundbar" DEFAULT_PORT = 9741 diff --git a/homeassistant/components/light/group.py b/homeassistant/components/light/group.py index 234883ffd5a..e1a0b18dd08 100644 --- a/homeassistant/components/light/group.py +++ b/homeassistant/components/light/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/litterrobot/const.py b/homeassistant/components/litterrobot/const.py index 5ac889d9b73..632465b902d 100644 --- a/homeassistant/components/litterrobot/const.py +++ b/homeassistant/components/litterrobot/const.py @@ -1,2 +1,3 @@ """Constants for the Litter-Robot integration.""" + DOMAIN = "litterrobot" diff --git a/homeassistant/components/local_file/const.py b/homeassistant/components/local_file/const.py index 3ea98f89c0e..03f6cf641f1 100644 --- a/homeassistant/components/local_file/const.py +++ b/homeassistant/components/local_file/const.py @@ -1,4 +1,5 @@ """Constants for the Local File Camera component.""" + DOMAIN = "local_file" SERVICE_UPDATE_FILE_PATH = "update_file_path" DATA_LOCAL_FILE = "local_file_cameras" diff --git a/homeassistant/components/lock/group.py b/homeassistant/components/lock/group.py index 9cf460dc019..03e576af307 100644 --- a/homeassistant/components/lock/group.py +++ b/homeassistant/components/lock/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/loqed/const.py b/homeassistant/components/loqed/const.py index 59011f26566..262009e20ae 100644 --- a/homeassistant/components/loqed/const.py +++ b/homeassistant/components/loqed/const.py @@ -1,5 +1,4 @@ """Constants for the loqed integration.""" - DOMAIN = "loqed" CONF_CLOUDHOOK_URL = "cloudhook_url" diff --git a/homeassistant/components/matrix/const.py b/homeassistant/components/matrix/const.py index b7e0c22e2ac..bae53f05727 100644 --- a/homeassistant/components/matrix/const.py +++ b/homeassistant/components/matrix/const.py @@ -1,4 +1,5 @@ """Constants for the Matrix integration.""" + DOMAIN = "matrix" SERVICE_SEND_MESSAGE = "send_message" diff --git a/homeassistant/components/media_player/group.py b/homeassistant/components/media_player/group.py index b7b2efb55c8..2194f71edf4 100644 --- a/homeassistant/components/media_player/group.py +++ b/homeassistant/components/media_player/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import ( STATE_IDLE, diff --git a/homeassistant/components/melnor/const.py b/homeassistant/components/melnor/const.py index cadf9c0a618..be6931799af 100644 --- a/homeassistant/components/melnor/const.py +++ b/homeassistant/components/melnor/const.py @@ -1,6 +1,5 @@ """Constants for the melnor integration.""" - DOMAIN = "melnor" DEFAULT_NAME = "Melnor Bluetooth" diff --git a/homeassistant/components/minecraft_server/api.py b/homeassistant/components/minecraft_server/api.py index d86f8453413..7b0d7475f84 100644 --- a/homeassistant/components/minecraft_server/api.py +++ b/homeassistant/components/minecraft_server/api.py @@ -1,6 +1,5 @@ """API for the Minecraft Server integration.""" - from dataclasses import dataclass from enum import StrEnum import logging diff --git a/homeassistant/components/mystrom/const.py b/homeassistant/components/mystrom/const.py index 5641463abf1..0e576d47438 100644 --- a/homeassistant/components/mystrom/const.py +++ b/homeassistant/components/mystrom/const.py @@ -1,4 +1,5 @@ """Constants for the myStrom integration.""" + DOMAIN = "mystrom" DEFAULT_NAME = "myStrom" MANUFACTURER = "myStrom" diff --git a/homeassistant/components/myuplink/number.py b/homeassistant/components/myuplink/number.py index ddfcdb109d4..55662fb57fb 100644 --- a/homeassistant/components/myuplink/number.py +++ b/homeassistant/components/myuplink/number.py @@ -1,6 +1,5 @@ """Number entity for myUplink.""" - from aiohttp import ClientError from myuplink import DevicePoint diff --git a/homeassistant/components/nextbus/const.py b/homeassistant/components/nextbus/const.py index 0a2eabf57b3..aa125193031 100644 --- a/homeassistant/components/nextbus/const.py +++ b/homeassistant/components/nextbus/const.py @@ -1,4 +1,5 @@ """NextBus Constants.""" + DOMAIN = "nextbus" CONF_AGENCY = "agency" diff --git a/homeassistant/components/nfandroidtv/const.py b/homeassistant/components/nfandroidtv/const.py index 4d4a7c82ecb..cd4b99d0981 100644 --- a/homeassistant/components/nfandroidtv/const.py +++ b/homeassistant/components/nfandroidtv/const.py @@ -1,4 +1,5 @@ """Constants for the NFAndroidTV integration.""" + DOMAIN: str = "nfandroidtv" CONF_DURATION = "duration" CONF_FONTSIZE = "fontsize" diff --git a/homeassistant/components/nuki/const.py b/homeassistant/components/nuki/const.py index 21a2dcf9e5b..28975f37432 100644 --- a/homeassistant/components/nuki/const.py +++ b/homeassistant/components/nuki/const.py @@ -1,4 +1,5 @@ """Constants for Nuki.""" + DOMAIN = "nuki" # Attributes diff --git a/homeassistant/components/nzbget/const.py b/homeassistant/components/nzbget/const.py index 7838d64c6d7..6742567bbf2 100644 --- a/homeassistant/components/nzbget/const.py +++ b/homeassistant/components/nzbget/const.py @@ -1,4 +1,5 @@ """Constants for NZBGet.""" + DOMAIN = "nzbget" # Attributes diff --git a/homeassistant/components/onboarding/const.py b/homeassistant/components/onboarding/const.py index 5a771f524ac..7ccfc13774d 100644 --- a/homeassistant/components/onboarding/const.py +++ b/homeassistant/components/onboarding/const.py @@ -1,4 +1,5 @@ """Constants for the onboarding component.""" + DOMAIN = "onboarding" STEP_USER = "user" STEP_CORE_CONFIG = "core_config" diff --git a/homeassistant/components/oncue/const.py b/homeassistant/components/oncue/const.py index 599ef5ee22b..bc14133b0d3 100644 --- a/homeassistant/components/oncue/const.py +++ b/homeassistant/components/oncue/const.py @@ -1,6 +1,5 @@ """Constants for the Oncue integration.""" - import aiohttp from aiooncue import ServiceFailedException diff --git a/homeassistant/components/openhome/const.py b/homeassistant/components/openhome/const.py index 09fcd2ef0e2..4c9925df19e 100644 --- a/homeassistant/components/openhome/const.py +++ b/homeassistant/components/openhome/const.py @@ -1,4 +1,5 @@ """Constants for the Openhome component.""" + DOMAIN = "openhome" SERVICE_INVOKE_PIN = "invoke_pin" ATTR_PIN_INDEX = "pin" diff --git a/homeassistant/components/ovo_energy/const.py b/homeassistant/components/ovo_energy/const.py index 1068c5443fd..2d615e7c44a 100644 --- a/homeassistant/components/ovo_energy/const.py +++ b/homeassistant/components/ovo_energy/const.py @@ -1,4 +1,5 @@ """Constants for the OVO Energy integration.""" + DOMAIN = "ovo_energy" DATA_CLIENT = "ovo_client" diff --git a/homeassistant/components/owntracks/helper.py b/homeassistant/components/owntracks/helper.py index a9499059ba0..f88dcb03864 100644 --- a/homeassistant/components/owntracks/helper.py +++ b/homeassistant/components/owntracks/helper.py @@ -1,4 +1,5 @@ """Helper for OwnTracks.""" + try: import nacl except ImportError: diff --git a/homeassistant/components/panasonic_viera/const.py b/homeassistant/components/panasonic_viera/const.py index a2e3fc2eece..f76c01e396b 100644 --- a/homeassistant/components/panasonic_viera/const.py +++ b/homeassistant/components/panasonic_viera/const.py @@ -1,4 +1,5 @@ """Constants for the Panasonic Viera integration.""" + DOMAIN = "panasonic_viera" DEVICE_MANUFACTURER = "Panasonic" diff --git a/homeassistant/components/person/group.py b/homeassistant/components/person/group.py index 9bd2c991678..97e9556eaeb 100644 --- a/homeassistant/components/person/group.py +++ b/homeassistant/components/person/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import STATE_HOME, STATE_NOT_HOME from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/plant/group.py b/homeassistant/components/plant/group.py index 90e894abb0f..0a29f748a76 100644 --- a/homeassistant/components/plant/group.py +++ b/homeassistant/components/plant/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import STATE_OK, STATE_PROBLEM from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/private_ble_device/const.py b/homeassistant/components/private_ble_device/const.py index 086fd06bfd5..4eaf862ca75 100644 --- a/homeassistant/components/private_ble_device/const.py +++ b/homeassistant/components/private_ble_device/const.py @@ -1,2 +1,3 @@ """Constants for Private BLE Device.""" + DOMAIN = "private_ble_device" diff --git a/homeassistant/components/ps4/const.py b/homeassistant/components/ps4/const.py index 20b4feda5fa..bd1144c4d98 100644 --- a/homeassistant/components/ps4/const.py +++ b/homeassistant/components/ps4/const.py @@ -1,4 +1,5 @@ """Constants for PlayStation 4.""" + ATTR_MEDIA_IMAGE_URL = "media_image_url" CONFIG_ENTRY_VERSION = 3 DEFAULT_NAME = "PlayStation 4" diff --git a/homeassistant/components/rainforest_raven/const.py b/homeassistant/components/rainforest_raven/const.py index a5269ddbc26..ca46f0303cc 100644 --- a/homeassistant/components/rainforest_raven/const.py +++ b/homeassistant/components/rainforest_raven/const.py @@ -1,3 +1,4 @@ """Constants for the Rainforest RAVEn integration.""" + DEFAULT_NAME = "Rainforest RAVEn" DOMAIN = "rainforest_raven" diff --git a/homeassistant/components/random/const.py b/homeassistant/components/random/const.py index df6a18f8d11..a35ce4315a4 100644 --- a/homeassistant/components/random/const.py +++ b/homeassistant/components/random/const.py @@ -1,4 +1,5 @@ """Constants for random helper.""" + DOMAIN = "random" DEFAULT_MIN = 0 diff --git a/homeassistant/components/recorder/history/const.py b/homeassistant/components/recorder/history/const.py index 61a615a7979..f5286a3ff3d 100644 --- a/homeassistant/components/recorder/history/const.py +++ b/homeassistant/components/recorder/history/const.py @@ -1,6 +1,5 @@ """Constants for history.""" - STATE_KEY = "state" LAST_CHANGED_KEY = "last_changed" diff --git a/homeassistant/components/remote/group.py b/homeassistant/components/remote/group.py index 234883ffd5a..e1a0b18dd08 100644 --- a/homeassistant/components/remote/group.py +++ b/homeassistant/components/remote/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/renson/const.py b/homeassistant/components/renson/const.py index 53bbd90c4b7..840e1ce428a 100644 --- a/homeassistant/components/renson/const.py +++ b/homeassistant/components/renson/const.py @@ -1,4 +1,3 @@ """Constants for the Renson integration.""" - DOMAIN = "renson" diff --git a/homeassistant/components/rfxtrx/helpers.py b/homeassistant/components/rfxtrx/helpers.py index cfc16126359..184d814a6cc 100644 --- a/homeassistant/components/rfxtrx/helpers.py +++ b/homeassistant/components/rfxtrx/helpers.py @@ -1,6 +1,5 @@ """Provides helpers for RFXtrx.""" - from RFXtrx import RFXtrxDevice, get_device from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/roku/const.py b/homeassistant/components/roku/const.py index f098483e0c6..ab633a4044c 100644 --- a/homeassistant/components/roku/const.py +++ b/homeassistant/components/roku/const.py @@ -1,4 +1,5 @@ """Constants for the Roku integration.""" + DOMAIN = "roku" # Attributes diff --git a/homeassistant/components/romy/vacuum.py b/homeassistant/components/romy/vacuum.py index f352f528c58..90189da7e2f 100644 --- a/homeassistant/components/romy/vacuum.py +++ b/homeassistant/components/romy/vacuum.py @@ -4,7 +4,6 @@ For more details about this platform, please refer to the documentation https://home-assistant.io/components/vacuum.romy/. """ - from typing import Any from romy import RomyRobot diff --git a/homeassistant/components/sensor/group.py b/homeassistant/components/sensor/group.py index 2ac081496cd..162457d336f 100644 --- a/homeassistant/components/sensor/group.py +++ b/homeassistant/components/sensor/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/slimproto/const.py b/homeassistant/components/slimproto/const.py index 3b85de5d794..e8ef4fbd148 100644 --- a/homeassistant/components/slimproto/const.py +++ b/homeassistant/components/slimproto/const.py @@ -1,6 +1,5 @@ """Constants for SlimProto Player integration.""" - DOMAIN = "slimproto" DEFAULT_NAME = "SlimProto Player" diff --git a/homeassistant/components/snmp/const.py b/homeassistant/components/snmp/const.py index e51bbc33b90..842c0eaec9e 100644 --- a/homeassistant/components/snmp/const.py +++ b/homeassistant/components/snmp/const.py @@ -1,4 +1,5 @@ """SNMP constants.""" + CONF_ACCEPT_ERRORS = "accept_errors" CONF_AUTH_KEY = "auth_key" CONF_AUTH_PROTOCOL = "auth_protocol" diff --git a/homeassistant/components/solax/const.py b/homeassistant/components/solax/const.py index 65894013adc..26d5962e385 100644 --- a/homeassistant/components/solax/const.py +++ b/homeassistant/components/solax/const.py @@ -1,6 +1,5 @@ """Constants for the solax integration.""" - DOMAIN = "solax" MANUFACTURER = "SolaX Power" diff --git a/homeassistant/components/songpal/const.py b/homeassistant/components/songpal/const.py index 496618f35f0..04b005e2a09 100644 --- a/homeassistant/components/songpal/const.py +++ b/homeassistant/components/songpal/const.py @@ -1,4 +1,5 @@ """Constants for the Songpal component.""" + DOMAIN = "songpal" SET_SOUND_SETTING = "set_sound_setting" diff --git a/homeassistant/components/soundtouch/const.py b/homeassistant/components/soundtouch/const.py index a6b2b3c9f5f..ef9d7e71bf9 100644 --- a/homeassistant/components/soundtouch/const.py +++ b/homeassistant/components/soundtouch/const.py @@ -1,4 +1,5 @@ """Constants for the Bose SoundTouch component.""" + DOMAIN = "soundtouch" SERVICE_PLAY_EVERYWHERE = "play_everywhere" SERVICE_CREATE_ZONE = "create_zone" diff --git a/homeassistant/components/squeezebox/const.py b/homeassistant/components/squeezebox/const.py index 38a9ef7668f..96a541a16ba 100644 --- a/homeassistant/components/squeezebox/const.py +++ b/homeassistant/components/squeezebox/const.py @@ -1,4 +1,5 @@ """Constants for the Squeezebox component.""" + DOMAIN = "squeezebox" ENTRY_PLAYERS = "entry_players" KNOWN_PLAYERS = "known_players" diff --git a/homeassistant/components/steamist/const.py b/homeassistant/components/steamist/const.py index ae75193a3cc..d505e534f04 100644 --- a/homeassistant/components/steamist/const.py +++ b/homeassistant/components/steamist/const.py @@ -1,6 +1,5 @@ """Constants for the Steamist integration.""" - import aiohttp DOMAIN = "steamist" diff --git a/homeassistant/components/stream/const.py b/homeassistant/components/stream/const.py index eb954a6a8f5..a2fa065e019 100644 --- a/homeassistant/components/stream/const.py +++ b/homeassistant/components/stream/const.py @@ -1,4 +1,5 @@ """Constants for Stream component.""" + DOMAIN = "stream" ATTR_ENDPOINTS = "endpoints" diff --git a/homeassistant/components/surepetcare/const.py b/homeassistant/components/surepetcare/const.py index 6617137b026..e0940b41002 100644 --- a/homeassistant/components/surepetcare/const.py +++ b/homeassistant/components/surepetcare/const.py @@ -1,4 +1,5 @@ """Constants for the Sure Petcare component.""" + DOMAIN = "surepetcare" CONF_FEEDERS = "feeders" diff --git a/homeassistant/components/switch/group.py b/homeassistant/components/switch/group.py index 234883ffd5a..e1a0b18dd08 100644 --- a/homeassistant/components/switch/group.py +++ b/homeassistant/components/switch/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/switcher_kis/const.py b/homeassistant/components/switcher_kis/const.py index fdd5b02fe9b..248b7afbc81 100644 --- a/homeassistant/components/switcher_kis/const.py +++ b/homeassistant/components/switcher_kis/const.py @@ -1,4 +1,5 @@ """Constants for the Switcher integration.""" + DOMAIN = "switcher_kis" CONF_DEVICE_PASSWORD = "device_password" diff --git a/homeassistant/components/tami4/const.py b/homeassistant/components/tami4/const.py index 4e64bdf896d..be737b5c974 100644 --- a/homeassistant/components/tami4/const.py +++ b/homeassistant/components/tami4/const.py @@ -1,4 +1,5 @@ """Constants for tami4 component.""" + DOMAIN = "tami4" CONF_PHONE = "phone" CONF_REFRESH_TOKEN = "refresh_token" diff --git a/homeassistant/components/trend/const.py b/homeassistant/components/trend/const.py index 838056bfc4d..5c1c5b9629b 100644 --- a/homeassistant/components/trend/const.py +++ b/homeassistant/components/trend/const.py @@ -1,4 +1,5 @@ """Constant values for Trend integration.""" + DOMAIN = "trend" ATTR_ATTRIBUTE = "attribute" diff --git a/homeassistant/components/tts/const.py b/homeassistant/components/tts/const.py index f721731330c..99015512498 100644 --- a/homeassistant/components/tts/const.py +++ b/homeassistant/components/tts/const.py @@ -1,4 +1,5 @@ """Text-to-speech constants.""" + ATTR_CACHE = "cache" ATTR_LANGUAGE = "language" ATTR_MESSAGE = "message" diff --git a/homeassistant/components/twinkly/__init__.py b/homeassistant/components/twinkly/__init__.py index 3b47a10d499..b09e58ff12f 100644 --- a/homeassistant/components/twinkly/__init__.py +++ b/homeassistant/components/twinkly/__init__.py @@ -1,6 +1,5 @@ """The twinkly component.""" - from aiohttp import ClientError from ttls.client import Twinkly diff --git a/homeassistant/components/utility_meter/const.py b/homeassistant/components/utility_meter/const.py index 4f62925069d..49799ba1e67 100644 --- a/homeassistant/components/utility_meter/const.py +++ b/homeassistant/components/utility_meter/const.py @@ -1,4 +1,5 @@ """Constants for the utility meter component.""" + DOMAIN = "utility_meter" QUARTER_HOURLY = "quarter-hourly" diff --git a/homeassistant/components/vacuum/group.py b/homeassistant/components/vacuum/group.py index e5a1734420f..71aecfbabc5 100644 --- a/homeassistant/components/vacuum/group.py +++ b/homeassistant/components/vacuum/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/vacuum/intent.py b/homeassistant/components/vacuum/intent.py index c485686aa23..534078ec8af 100644 --- a/homeassistant/components/vacuum/intent.py +++ b/homeassistant/components/vacuum/intent.py @@ -1,6 +1,5 @@ """Intents for the vacuum integration.""" - from homeassistant.core import HomeAssistant from homeassistant.helpers import intent diff --git a/homeassistant/components/vera/const.py b/homeassistant/components/vera/const.py index 34ac7faa669..0eb7534a81d 100644 --- a/homeassistant/components/vera/const.py +++ b/homeassistant/components/vera/const.py @@ -1,4 +1,5 @@ """Vera constants.""" + DOMAIN = "vera" CONF_CONTROLLER = "vera_controller_url" diff --git a/homeassistant/components/versasense/const.py b/homeassistant/components/versasense/const.py index 5283f61ac26..4f24fe637bb 100644 --- a/homeassistant/components/versasense/const.py +++ b/homeassistant/components/versasense/const.py @@ -1,4 +1,5 @@ """Constants for versasense.""" + KEY_CONSUMER = "consumer" KEY_IDENTIFIER = "identifier" KEY_MEASUREMENT = "measurement" diff --git a/homeassistant/components/wake_on_lan/const.py b/homeassistant/components/wake_on_lan/const.py index 14f2bd0263f..2560ef40382 100644 --- a/homeassistant/components/wake_on_lan/const.py +++ b/homeassistant/components/wake_on_lan/const.py @@ -1,2 +1,3 @@ """Constants for the Wake-On-LAN component.""" + DOMAIN = "wake_on_lan" diff --git a/homeassistant/components/wake_word/const.py b/homeassistant/components/wake_word/const.py index fdca6cfab6e..26027c61934 100644 --- a/homeassistant/components/wake_word/const.py +++ b/homeassistant/components/wake_word/const.py @@ -1,2 +1,3 @@ """Wake word constants.""" + DOMAIN = "wake_word" diff --git a/homeassistant/components/water_heater/group.py b/homeassistant/components/water_heater/group.py index 59d5478b1ab..16387d5abd7 100644 --- a/homeassistant/components/water_heater/group.py +++ b/homeassistant/components/water_heater/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.const import STATE_OFF from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/weather/group.py b/homeassistant/components/weather/group.py index 2ac081496cd..162457d336f 100644 --- a/homeassistant/components/weather/group.py +++ b/homeassistant/components/weather/group.py @@ -1,6 +1,5 @@ """Describe group states.""" - from homeassistant.components.group import GroupIntegrationRegistry from homeassistant.core import HomeAssistant, callback diff --git a/homeassistant/components/weatherkit/sensor.py b/homeassistant/components/weatherkit/sensor.py index 28e828eee94..d9c17bb855a 100644 --- a/homeassistant/components/weatherkit/sensor.py +++ b/homeassistant/components/weatherkit/sensor.py @@ -1,6 +1,5 @@ """WeatherKit sensors.""" - from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, diff --git a/homeassistant/components/wemo/const.py b/homeassistant/components/wemo/const.py index ec59e713b0d..0bde98acb24 100644 --- a/homeassistant/components/wemo/const.py +++ b/homeassistant/components/wemo/const.py @@ -1,4 +1,5 @@ """Constants for the Belkin Wemo component.""" + DOMAIN = "wemo" SERVICE_SET_HUMIDITY = "set_humidity" diff --git a/homeassistant/components/yamaha/const.py b/homeassistant/components/yamaha/const.py index bcfdc55a511..c0f4e34dd50 100644 --- a/homeassistant/components/yamaha/const.py +++ b/homeassistant/components/yamaha/const.py @@ -1,4 +1,5 @@ """Constants for the Yamaha component.""" + DOMAIN = "yamaha" CURSOR_TYPE_DOWN = "down" CURSOR_TYPE_LEFT = "left" diff --git a/homeassistant/components/zerproc/const.py b/homeassistant/components/zerproc/const.py index 69d5fcfb740..4922bef91d0 100644 --- a/homeassistant/components/zerproc/const.py +++ b/homeassistant/components/zerproc/const.py @@ -1,4 +1,5 @@ """Constants for the Zerproc integration.""" + DOMAIN = "zerproc" DATA_ADDRESSES = "addresses" diff --git a/homeassistant/components/zodiac/const.py b/homeassistant/components/zodiac/const.py index f50e108c2aa..9b2600b0c96 100644 --- a/homeassistant/components/zodiac/const.py +++ b/homeassistant/components/zodiac/const.py @@ -1,4 +1,5 @@ """Constants for Zodiac.""" + DOMAIN = "zodiac" DEFAULT_NAME = "Zodiac" diff --git a/homeassistant/util/yaml/const.py b/homeassistant/util/yaml/const.py index 9d930b50fd6..811c7d149f7 100644 --- a/homeassistant/util/yaml/const.py +++ b/homeassistant/util/yaml/const.py @@ -1,2 +1,3 @@ """Constants.""" + SECRET_YAML = "secrets.yaml" diff --git a/script/translations/deduplicate.py b/script/translations/deduplicate.py index 27764f0987f..8cc4cee3b10 100644 --- a/script/translations/deduplicate.py +++ b/script/translations/deduplicate.py @@ -1,6 +1,5 @@ """Deduplicate translations in strings.json.""" - import argparse import json from pathlib import Path diff --git a/tests/components/accuweather/__init__.py b/tests/components/accuweather/__init__.py index 3c7f81450c6..51ced2202bd 100644 --- a/tests/components/accuweather/__init__.py +++ b/tests/components/accuweather/__init__.py @@ -1,4 +1,5 @@ """Tests for AccuWeather.""" + from unittest.mock import PropertyMock, patch from homeassistant.components.accuweather.const import DOMAIN diff --git a/tests/components/advantage_air/test_light.py b/tests/components/advantage_air/test_light.py index 4d21781772d..b22c22fa185 100644 --- a/tests/components/advantage_air/test_light.py +++ b/tests/components/advantage_air/test_light.py @@ -1,6 +1,5 @@ """Test the Advantage Air Switch Platform.""" - from unittest.mock import AsyncMock from homeassistant.components.light import ( diff --git a/tests/components/advantage_air/test_select.py b/tests/components/advantage_air/test_select.py index 3367595d777..f0ed2b41e36 100644 --- a/tests/components/advantage_air/test_select.py +++ b/tests/components/advantage_air/test_select.py @@ -1,6 +1,5 @@ """Test the Advantage Air Select Platform.""" - from unittest.mock import AsyncMock from homeassistant.components.select import ( diff --git a/tests/components/airly/__init__.py b/tests/components/airly/__init__.py index ca26dbaf87f..cf76296d49a 100644 --- a/tests/components/airly/__init__.py +++ b/tests/components/airly/__init__.py @@ -1,4 +1,5 @@ """Tests for Airly.""" + from homeassistant.components.airly.const import DOMAIN from tests.common import MockConfigEntry, load_fixture diff --git a/tests/components/airthings_ble/__init__.py b/tests/components/airthings_ble/__init__.py index 5da9d8b48cd..0dfc894252e 100644 --- a/tests/components/airthings_ble/__init__.py +++ b/tests/components/airthings_ble/__init__.py @@ -1,4 +1,5 @@ """Tests for the Airthings BLE integration.""" + from __future__ import annotations from unittest.mock import patch diff --git a/tests/components/analytics_insights/__init__.py b/tests/components/analytics_insights/__init__.py index 9e20a72c438..7dad32c2ed5 100644 --- a/tests/components/analytics_insights/__init__.py +++ b/tests/components/analytics_insights/__init__.py @@ -1,4 +1,5 @@ """Tests for the Homeassistant Analytics integration.""" + from homeassistant.core import HomeAssistant from tests.common import MockConfigEntry diff --git a/tests/components/android_ip_webcam/test_init.py b/tests/components/android_ip_webcam/test_init.py index fa5f551e9b1..9aa677b8708 100644 --- a/tests/components/android_ip_webcam/test_init.py +++ b/tests/components/android_ip_webcam/test_init.py @@ -1,6 +1,5 @@ """Tests for the Android IP Webcam integration.""" - from unittest.mock import Mock import aiohttp diff --git a/tests/components/apcupsd/__init__.py b/tests/components/apcupsd/__init__.py index 4c4e0af8705..b75f3eab3af 100644 --- a/tests/components/apcupsd/__init__.py +++ b/tests/components/apcupsd/__init__.py @@ -1,4 +1,5 @@ """Tests for the APCUPSd component.""" + from collections import OrderedDict from typing import Final from unittest.mock import patch diff --git a/tests/components/apple_tv/__init__.py b/tests/components/apple_tv/__init__.py index 118c3d6f735..514d77bde4d 100644 --- a/tests/components/apple_tv/__init__.py +++ b/tests/components/apple_tv/__init__.py @@ -1,4 +1,5 @@ """Tests for Apple TV.""" + import pytest # Make asserts in the common module display differences diff --git a/tests/components/assist_pipeline/__init__.py b/tests/components/assist_pipeline/__init__.py index 40aa48fbc54..7400fe32d70 100644 --- a/tests/components/assist_pipeline/__init__.py +++ b/tests/components/assist_pipeline/__init__.py @@ -1,4 +1,5 @@ """Tests for the Voice Assistant integration.""" + MANY_LANGUAGES = [ "ar", "bg", diff --git a/tests/components/auth/__init__.py b/tests/components/auth/__init__.py index 8b731934913..18904cb2710 100644 --- a/tests/components/auth/__init__.py +++ b/tests/components/auth/__init__.py @@ -1,4 +1,5 @@ """Tests for the auth component.""" + from typing import Any from homeassistant import auth diff --git a/tests/components/awair/__init__.py b/tests/components/awair/__init__.py index e8b93e47fd7..f93866263a2 100644 --- a/tests/components/awair/__init__.py +++ b/tests/components/awair/__init__.py @@ -1,6 +1,5 @@ """Tests for the awair component.""" - from unittest.mock import patch from homeassistant.components.awair import DOMAIN diff --git a/tests/components/baf/__init__.py b/tests/components/baf/__init__.py index 4e435dc1a2e..648f235349d 100644 --- a/tests/components/baf/__init__.py +++ b/tests/components/baf/__init__.py @@ -1,6 +1,5 @@ """Tests for the Big Ass Fans integration.""" - import asyncio from aiobafi6 import Device diff --git a/tests/components/balboa/__init__.py b/tests/components/balboa/__init__.py index 9ea41eb2463..a27293e955f 100644 --- a/tests/components/balboa/__init__.py +++ b/tests/components/balboa/__init__.py @@ -1,4 +1,5 @@ """Test the Balboa Spa Client integration.""" + from __future__ import annotations from unittest.mock import MagicMock diff --git a/tests/components/bang_olufsen/const.py b/tests/components/bang_olufsen/const.py index 1b13e1b3412..187f93108a1 100644 --- a/tests/components/bang_olufsen/const.py +++ b/tests/components/bang_olufsen/const.py @@ -1,6 +1,5 @@ """Constants used for testing the bang_olufsen integration.""" - from ipaddress import IPv4Address, IPv6Address from homeassistant.components.bang_olufsen.const import ( diff --git a/tests/components/bang_olufsen/test_config_flow.py b/tests/components/bang_olufsen/test_config_flow.py index 793ef0c2c9b..d813ddf185b 100644 --- a/tests/components/bang_olufsen/test_config_flow.py +++ b/tests/components/bang_olufsen/test_config_flow.py @@ -1,6 +1,5 @@ """Test the bang_olufsen config_flow.""" - from unittest.mock import Mock from aiohttp.client_exceptions import ClientConnectorError diff --git a/tests/components/blue_current/__init__.py b/tests/components/blue_current/__init__.py index 63d8d084fae..e020855b59c 100644 --- a/tests/components/blue_current/__init__.py +++ b/tests/components/blue_current/__init__.py @@ -1,4 +1,5 @@ """Tests for the Blue Current integration.""" + from __future__ import annotations from asyncio import Event, Future diff --git a/tests/components/bluemaestro/__init__.py b/tests/components/bluemaestro/__init__.py index bd9b86e040f..412bc3cb7b3 100644 --- a/tests/components/bluemaestro/__init__.py +++ b/tests/components/bluemaestro/__init__.py @@ -1,6 +1,5 @@ """Tests for the BlueMaestro integration.""" - from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo NOT_BLUEMAESTRO_SERVICE_INFO = BluetoothServiceInfo( diff --git a/tests/components/bluetooth/__init__.py b/tests/components/bluetooth/__init__.py index f4616abf8e5..b6d7220da16 100644 --- a/tests/components/bluetooth/__init__.py +++ b/tests/components/bluetooth/__init__.py @@ -1,6 +1,5 @@ """Tests for the Bluetooth integration.""" - from collections.abc import Iterable from contextlib import contextmanager import itertools diff --git a/tests/components/bmw_connected_drive/__init__.py b/tests/components/bmw_connected_drive/__init__.py index 020e4c978ed..84384e6b482 100644 --- a/tests/components/bmw_connected_drive/__init__.py +++ b/tests/components/bmw_connected_drive/__init__.py @@ -1,6 +1,5 @@ """Tests for the for the BMW Connected Drive integration.""" - from bimmer_connected.const import REMOTE_SERVICE_BASE_URL, VEHICLE_CHARGING_BASE_URL import respx diff --git a/tests/components/bmw_connected_drive/conftest.py b/tests/components/bmw_connected_drive/conftest.py index 4191c7a4dd2..c3a89e28bd6 100644 --- a/tests/components/bmw_connected_drive/conftest.py +++ b/tests/components/bmw_connected_drive/conftest.py @@ -1,6 +1,5 @@ """Fixtures for BMW tests.""" - from collections.abc import Generator from bimmer_connected.tests import ALL_CHARGING_SETTINGS, ALL_STATES diff --git a/tests/components/broadlink/__init__.py b/tests/components/broadlink/__init__.py index 8cdb4f478a3..c9245fb16fa 100644 --- a/tests/components/broadlink/__init__.py +++ b/tests/components/broadlink/__init__.py @@ -1,4 +1,5 @@ """Tests for the Broadlink integration.""" + from dataclasses import dataclass from unittest.mock import MagicMock, patch diff --git a/tests/components/brother/__init__.py b/tests/components/brother/__init__.py index 8e24c2d8058..591a227c3b5 100644 --- a/tests/components/brother/__init__.py +++ b/tests/components/brother/__init__.py @@ -1,4 +1,5 @@ """Tests for Brother Printer integration.""" + import json from unittest.mock import patch diff --git a/tests/components/bthome/__init__.py b/tests/components/bthome/__init__.py index de46cd8231d..ae7231b8740 100644 --- a/tests/components/bthome/__init__.py +++ b/tests/components/bthome/__init__.py @@ -1,6 +1,5 @@ """Tests for the BTHome integration.""" - from homeassistant.components.bluetooth import BluetoothServiceInfoBleak from tests.components.bluetooth import generate_advertisement_data, generate_ble_device diff --git a/tests/components/canary/__init__.py b/tests/components/canary/__init__.py index 46737929dc5..8aed2fa1337 100644 --- a/tests/components/canary/__init__.py +++ b/tests/components/canary/__init__.py @@ -1,4 +1,5 @@ """Tests for the Canary integration.""" + from unittest.mock import MagicMock, PropertyMock, patch from canary.model import SensorType diff --git a/tests/components/cert_expiry/const.py b/tests/components/cert_expiry/const.py index 9ddbeca61c3..14a002fc6e5 100644 --- a/tests/components/cert_expiry/const.py +++ b/tests/components/cert_expiry/const.py @@ -1,3 +1,4 @@ """Constants for cert_expiry tests.""" + PORT = 443 HOST = "example.com" diff --git a/tests/components/cloud/__init__.py b/tests/components/cloud/__init__.py index e6e793ed106..2b4a95a61d9 100644 --- a/tests/components/cloud/__init__.py +++ b/tests/components/cloud/__init__.py @@ -1,4 +1,5 @@ """Tests for the cloud component.""" + from unittest.mock import AsyncMock, patch from hass_nabucasa import Cloud diff --git a/tests/components/cloudflare/__init__.py b/tests/components/cloudflare/__init__.py index 6b9e77dcb2a..ce9c6844f5a 100644 --- a/tests/components/cloudflare/__init__.py +++ b/tests/components/cloudflare/__init__.py @@ -1,4 +1,5 @@ """Tests for the Cloudflare integration.""" + from __future__ import annotations from unittest.mock import AsyncMock, patch diff --git a/tests/components/co2signal/__init__.py b/tests/components/co2signal/__init__.py index 65764d75fe4..394db24347b 100644 --- a/tests/components/co2signal/__init__.py +++ b/tests/components/co2signal/__init__.py @@ -1,4 +1,5 @@ """Tests for the CO2 Signal integration.""" + from aioelectricitymaps.models import ( CarbonIntensityData, CarbonIntensityResponse, diff --git a/tests/components/coinbase/const.py b/tests/components/coinbase/const.py index 138b941c62c..dcd14555ca3 100644 --- a/tests/components/coinbase/const.py +++ b/tests/components/coinbase/const.py @@ -1,6 +1,5 @@ """Constants for testing the Coinbase integration.""" - GOOD_CURRENCY = "BTC" GOOD_CURRENCY_2 = "USD" GOOD_CURRENCY_3 = "EUR" diff --git a/tests/components/comfoconnect/test_sensor.py b/tests/components/comfoconnect/test_sensor.py index a2cfdd3d13f..cea5ed0122f 100644 --- a/tests/components/comfoconnect/test_sensor.py +++ b/tests/components/comfoconnect/test_sensor.py @@ -1,4 +1,5 @@ """Tests for the comfoconnect sensor platform.""" + # import json from unittest.mock import patch diff --git a/tests/components/conversation/__init__.py b/tests/components/conversation/__init__.py index 648f8f33811..7209148e21f 100644 --- a/tests/components/conversation/__init__.py +++ b/tests/components/conversation/__init__.py @@ -1,4 +1,5 @@ """Tests for the conversation component.""" + from __future__ import annotations from typing import Literal diff --git a/tests/components/conversation/test_default_agent_intents.py b/tests/components/conversation/test_default_agent_intents.py index edf7e17682e..c57d93d8cef 100644 --- a/tests/components/conversation/test_default_agent_intents.py +++ b/tests/components/conversation/test_default_agent_intents.py @@ -1,6 +1,5 @@ """Test intents for the default agent.""" - import pytest from homeassistant.components import conversation, cover, media_player, vacuum, valve diff --git a/tests/components/devolo_home_control/__init__.py b/tests/components/devolo_home_control/__init__.py index a7217b0d530..f0e18eaf1a2 100644 --- a/tests/components/devolo_home_control/__init__.py +++ b/tests/components/devolo_home_control/__init__.py @@ -1,4 +1,5 @@ """Tests for the devolo_home_control integration.""" + from homeassistant.components.devolo_home_control.const import DOMAIN from homeassistant.core import HomeAssistant diff --git a/tests/components/devolo_home_network/__init__.py b/tests/components/devolo_home_network/__init__.py index ac6a960fd8f..05ccbca0c56 100644 --- a/tests/components/devolo_home_network/__init__.py +++ b/tests/components/devolo_home_network/__init__.py @@ -1,4 +1,5 @@ """Tests for the devolo Home Network integration.""" + from homeassistant.components.devolo_home_network.const import DOMAIN from homeassistant.const import CONF_IP_ADDRESS, CONF_PASSWORD from homeassistant.core import HomeAssistant diff --git a/tests/components/diagnostics/__init__.py b/tests/components/diagnostics/__init__.py index 5c81917b22c..81d62e7c2fe 100644 --- a/tests/components/diagnostics/__init__.py +++ b/tests/components/diagnostics/__init__.py @@ -1,4 +1,5 @@ """Tests for the Diagnostics integration.""" + from http import HTTPStatus from typing import cast diff --git a/tests/components/directv/__init__.py b/tests/components/directv/__init__.py index 584a7c95509..ae22e280000 100644 --- a/tests/components/directv/__init__.py +++ b/tests/components/directv/__init__.py @@ -1,4 +1,5 @@ """Tests for the DirecTV component.""" + from http import HTTPStatus from homeassistant.components import ssdp diff --git a/tests/components/dnsip/__init__.py b/tests/components/dnsip/__init__.py index 1a465b59ab6..d98de181892 100644 --- a/tests/components/dnsip/__init__.py +++ b/tests/components/dnsip/__init__.py @@ -1,4 +1,5 @@ """Tests for the dnsip integration.""" + from __future__ import annotations diff --git a/tests/components/dynalite/test_panel.py b/tests/components/dynalite/test_panel.py index a0acad54551..a1cd9749eb5 100644 --- a/tests/components/dynalite/test_panel.py +++ b/tests/components/dynalite/test_panel.py @@ -1,6 +1,5 @@ """Test websocket commands for the panel.""" - from unittest.mock import patch from homeassistant.components import dynalite diff --git a/tests/components/ecovacs/const.py b/tests/components/ecovacs/const.py index 237c7fa5c85..89d2e2a8166 100644 --- a/tests/components/ecovacs/const.py +++ b/tests/components/ecovacs/const.py @@ -1,6 +1,5 @@ """Test ecovacs constants.""" - from homeassistant.components.ecovacs.const import ( CONF_CONTINENT, CONF_OVERRIDE_MQTT_URL, diff --git a/tests/components/efergy/__init__.py b/tests/components/efergy/__init__.py index 3780bcb5494..d763aaa2fb6 100644 --- a/tests/components/efergy/__init__.py +++ b/tests/components/efergy/__init__.py @@ -1,4 +1,5 @@ """Tests for Efergy integration.""" + from unittest.mock import AsyncMock, patch from pyefergy import exceptions diff --git a/tests/components/electric_kiwi/test_sensor.py b/tests/components/electric_kiwi/test_sensor.py index 4961f5fdcd4..f91e4d9c58c 100644 --- a/tests/components/electric_kiwi/test_sensor.py +++ b/tests/components/electric_kiwi/test_sensor.py @@ -1,6 +1,5 @@ """The tests for Electric Kiwi sensors.""" - from datetime import UTC, datetime from unittest.mock import AsyncMock, Mock diff --git a/tests/components/elmax/__init__.py b/tests/components/elmax/__init__.py index 6d2e2333560..1434c831df3 100644 --- a/tests/components/elmax/__init__.py +++ b/tests/components/elmax/__init__.py @@ -1,4 +1,5 @@ """Tests for the Elmax component.""" + from tests.common import load_fixture MOCK_USER_JWT = ( diff --git a/tests/components/esphome/test_button.py b/tests/components/esphome/test_button.py index 71406341175..8c120949caa 100644 --- a/tests/components/esphome/test_button.py +++ b/tests/components/esphome/test_button.py @@ -1,6 +1,5 @@ """Test ESPHome buttones.""" - from unittest.mock import call from aioesphomeapi import APIClient, ButtonInfo diff --git a/tests/components/esphome/test_climate.py b/tests/components/esphome/test_climate.py index dbdee826137..4ec7fee6447 100644 --- a/tests/components/esphome/test_climate.py +++ b/tests/components/esphome/test_climate.py @@ -1,6 +1,5 @@ """Test ESPHome climates.""" - import math from unittest.mock import call diff --git a/tests/components/esphome/test_fan.py b/tests/components/esphome/test_fan.py index 6f383dcb6ba..064b37b1ec1 100644 --- a/tests/components/esphome/test_fan.py +++ b/tests/components/esphome/test_fan.py @@ -1,6 +1,5 @@ """Test ESPHome fans.""" - from unittest.mock import call from aioesphomeapi import ( diff --git a/tests/components/esphome/test_init.py b/tests/components/esphome/test_init.py index 8e7e228e422..7e008cde212 100644 --- a/tests/components/esphome/test_init.py +++ b/tests/components/esphome/test_init.py @@ -1,6 +1,5 @@ """ESPHome set up tests.""" - from homeassistant.components.esphome import DOMAIN from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT from homeassistant.core import HomeAssistant diff --git a/tests/components/esphome/test_light.py b/tests/components/esphome/test_light.py index fc63508a836..2324c73b16f 100644 --- a/tests/components/esphome/test_light.py +++ b/tests/components/esphome/test_light.py @@ -1,6 +1,5 @@ """Test ESPHome lights.""" - from unittest.mock import call from aioesphomeapi import ( diff --git a/tests/components/esphome/test_lock.py b/tests/components/esphome/test_lock.py index 83312c85934..82c24b59a2c 100644 --- a/tests/components/esphome/test_lock.py +++ b/tests/components/esphome/test_lock.py @@ -1,6 +1,5 @@ """Test ESPHome locks.""" - from unittest.mock import call from aioesphomeapi import APIClient, LockCommand, LockEntityState, LockInfo, LockState diff --git a/tests/components/esphome/test_select.py b/tests/components/esphome/test_select.py index 528483d4290..a433b1b0ab0 100644 --- a/tests/components/esphome/test_select.py +++ b/tests/components/esphome/test_select.py @@ -1,6 +1,5 @@ """Test ESPHome selects.""" - from unittest.mock import call from aioesphomeapi import APIClient, SelectInfo, SelectState diff --git a/tests/components/esphome/test_switch.py b/tests/components/esphome/test_switch.py index cd60eb70edd..561ac0b369f 100644 --- a/tests/components/esphome/test_switch.py +++ b/tests/components/esphome/test_switch.py @@ -1,6 +1,5 @@ """Test ESPHome switches.""" - from unittest.mock import call from aioesphomeapi import APIClient, SwitchInfo, SwitchState diff --git a/tests/components/eufylife_ble/__init__.py b/tests/components/eufylife_ble/__init__.py index 7fbeed9d798..f18d868efe1 100644 --- a/tests/components/eufylife_ble/__init__.py +++ b/tests/components/eufylife_ble/__init__.py @@ -1,6 +1,5 @@ """Tests for the EufyLife integration.""" - from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo NOT_EUFYLIFE_SERVICE_INFO = BluetoothServiceInfo( diff --git a/tests/components/ezviz/__init__.py b/tests/components/ezviz/__init__.py index 768fc30cc81..7872cf37b68 100644 --- a/tests/components/ezviz/__init__.py +++ b/tests/components/ezviz/__init__.py @@ -1,4 +1,5 @@ """Tests for the EZVIZ integration.""" + from unittest.mock import patch from homeassistant.components.ezviz.const import ( diff --git a/tests/components/fitbit/test_sensor.py b/tests/components/fitbit/test_sensor.py index 59405e3ea91..9443d0500eb 100644 --- a/tests/components/fitbit/test_sensor.py +++ b/tests/components/fitbit/test_sensor.py @@ -1,6 +1,5 @@ """Tests for the fitbit sensor platform.""" - from collections.abc import Awaitable, Callable from http import HTTPStatus from typing import Any diff --git a/tests/components/fjaraskupan/__init__.py b/tests/components/fjaraskupan/__init__.py index 5025fbeaf06..a55d7ea84c0 100644 --- a/tests/components/fjaraskupan/__init__.py +++ b/tests/components/fjaraskupan/__init__.py @@ -1,6 +1,5 @@ """Tests for the Fjäråskupan integration.""" - from homeassistant.components.bluetooth import BluetoothServiceInfoBleak from tests.components.bluetooth import generate_advertisement_data, generate_ble_device diff --git a/tests/components/flexit_bacnet/__init__.py b/tests/components/flexit_bacnet/__init__.py index e934f3c7e5f..c43f55dc33b 100644 --- a/tests/components/flexit_bacnet/__init__.py +++ b/tests/components/flexit_bacnet/__init__.py @@ -1,4 +1,5 @@ """Tests for the Flexit Nordic (BACnet) integration.""" + from unittest.mock import patch from homeassistant.const import Platform diff --git a/tests/components/flo/common.py b/tests/components/flo/common.py index d4018aae090..9ec1834b0c2 100644 --- a/tests/components/flo/common.py +++ b/tests/components/flo/common.py @@ -1,4 +1,5 @@ """Define common test utilities.""" + TEST_ACCOUNT_ID = "aabbccdd" TEST_DEVICE_ID = "98765" TEST_EMAIL_ADDRESS = "email@address.com" diff --git a/tests/components/flux_led/__init__.py b/tests/components/flux_led/__init__.py index 80f072328d6..4b36826728a 100644 --- a/tests/components/flux_led/__init__.py +++ b/tests/components/flux_led/__init__.py @@ -1,4 +1,5 @@ """Tests for the flux_led integration.""" + from __future__ import annotations import asyncio diff --git a/tests/components/flux_led/test_number.py b/tests/components/flux_led/test_number.py index 83bd0d1d517..5e16e4c0c2c 100644 --- a/tests/components/flux_led/test_number.py +++ b/tests/components/flux_led/test_number.py @@ -1,6 +1,5 @@ """Tests for the flux_led number platform.""" - from unittest.mock import patch from flux_led.const import COLOR_MODE_RGB as FLUX_COLOR_MODE_RGB diff --git a/tests/components/freebox/const.py b/tests/components/freebox/const.py index ae07b39c5e8..5211b793918 100644 --- a/tests/components/freebox/const.py +++ b/tests/components/freebox/const.py @@ -1,6 +1,5 @@ """Test constants.""" - from tests.common import load_json_array_fixture, load_json_object_fixture MOCK_HOST = "myrouter.freeboxos.fr" diff --git a/tests/components/fritzbox/__init__.py b/tests/components/fritzbox/__init__.py index 1faf37c84ee..8d366e39f6d 100644 --- a/tests/components/fritzbox/__init__.py +++ b/tests/components/fritzbox/__init__.py @@ -1,4 +1,5 @@ """Tests for the AVM Fritz!Box integration.""" + from __future__ import annotations from typing import Any diff --git a/tests/components/fronius/__init__.py b/tests/components/fronius/__init__.py index 2e053f7ccc5..5f0e86c292d 100644 --- a/tests/components/fronius/__init__.py +++ b/tests/components/fronius/__init__.py @@ -1,4 +1,5 @@ """Tests for the Fronius integration.""" + from __future__ import annotations from collections.abc import Callable diff --git a/tests/components/gardena_bluetooth/test_binary_sensor.py b/tests/components/gardena_bluetooth/test_binary_sensor.py index d12f825b1a7..97ba69ba239 100644 --- a/tests/components/gardena_bluetooth/test_binary_sensor.py +++ b/tests/components/gardena_bluetooth/test_binary_sensor.py @@ -1,6 +1,5 @@ """Test Gardena Bluetooth binary sensor.""" - from collections.abc import Awaitable, Callable from gardena_bluetooth.const import Valve diff --git a/tests/components/gardena_bluetooth/test_button.py b/tests/components/gardena_bluetooth/test_button.py index 480f0c3572e..685afd8c337 100644 --- a/tests/components/gardena_bluetooth/test_button.py +++ b/tests/components/gardena_bluetooth/test_button.py @@ -1,6 +1,5 @@ """Test Gardena Bluetooth sensor.""" - from collections.abc import Awaitable, Callable from unittest.mock import Mock, call diff --git a/tests/components/gardena_bluetooth/test_number.py b/tests/components/gardena_bluetooth/test_number.py index ce2d19b8c63..0bbe2e926cd 100644 --- a/tests/components/gardena_bluetooth/test_number.py +++ b/tests/components/gardena_bluetooth/test_number.py @@ -1,6 +1,5 @@ """Test Gardena Bluetooth sensor.""" - from collections.abc import Awaitable, Callable from typing import Any from unittest.mock import Mock, call diff --git a/tests/components/gardena_bluetooth/test_switch.py b/tests/components/gardena_bluetooth/test_switch.py index 40e8c148335..8478788de04 100644 --- a/tests/components/gardena_bluetooth/test_switch.py +++ b/tests/components/gardena_bluetooth/test_switch.py @@ -1,6 +1,5 @@ """Test Gardena Bluetooth sensor.""" - from collections.abc import Awaitable, Callable from unittest.mock import Mock, call diff --git a/tests/components/gdacs/__init__.py b/tests/components/gdacs/__init__.py index 6e61b86dbb7..01e13cca900 100644 --- a/tests/components/gdacs/__init__.py +++ b/tests/components/gdacs/__init__.py @@ -1,4 +1,5 @@ """Tests for the GDACS component.""" + from unittest.mock import MagicMock diff --git a/tests/components/geo_json_events/__init__.py b/tests/components/geo_json_events/__init__.py index 7d7148b3c20..18fbba47b6e 100644 --- a/tests/components/geo_json_events/__init__.py +++ b/tests/components/geo_json_events/__init__.py @@ -1,4 +1,5 @@ """Tests for the geo_json_events component.""" + from typing import Any from unittest.mock import MagicMock diff --git a/tests/components/geonetnz_quakes/__init__.py b/tests/components/geonetnz_quakes/__init__.py index 424c6372ea8..90375079daa 100644 --- a/tests/components/geonetnz_quakes/__init__.py +++ b/tests/components/geonetnz_quakes/__init__.py @@ -1,4 +1,5 @@ """Tests for the geonetnz_quakes component.""" + from unittest.mock import MagicMock diff --git a/tests/components/geonetnz_volcano/__init__.py b/tests/components/geonetnz_volcano/__init__.py index 708b69e0031..b8a36a124a3 100644 --- a/tests/components/geonetnz_volcano/__init__.py +++ b/tests/components/geonetnz_volcano/__init__.py @@ -1,4 +1,5 @@ """The tests for the GeoNet NZ Volcano Feed integration.""" + from unittest.mock import MagicMock diff --git a/tests/components/gios/__init__.py b/tests/components/gios/__init__.py index 4e69420f66e..482b58ad7ad 100644 --- a/tests/components/gios/__init__.py +++ b/tests/components/gios/__init__.py @@ -1,4 +1,5 @@ """Tests for GIOS.""" + import json from unittest.mock import patch diff --git a/tests/components/goalzero/__init__.py b/tests/components/goalzero/__init__.py index cde970f67a3..d2e990ca122 100644 --- a/tests/components/goalzero/__init__.py +++ b/tests/components/goalzero/__init__.py @@ -1,4 +1,5 @@ """Tests for the Goal Zero Yeti integration.""" + from unittest.mock import AsyncMock, patch from homeassistant.components import dhcp diff --git a/tests/components/google_assistant/__init__.py b/tests/components/google_assistant/__init__.py index e24e6b740d3..73dc109f7e6 100644 --- a/tests/components/google_assistant/__init__.py +++ b/tests/components/google_assistant/__init__.py @@ -1,4 +1,5 @@ """Tests for the Google Assistant integration.""" + from unittest.mock import MagicMock from homeassistant.components.google_assistant import helpers, http diff --git a/tests/components/google_tasks/conftest.py b/tests/components/google_tasks/conftest.py index 60387889aad..87ddb2ed81d 100644 --- a/tests/components/google_tasks/conftest.py +++ b/tests/components/google_tasks/conftest.py @@ -1,6 +1,5 @@ """Test fixtures for Google Tasks.""" - from collections.abc import Awaitable, Callable import time from typing import Any diff --git a/tests/components/google_tasks/test_todo.py b/tests/components/google_tasks/test_todo.py index ee1b1e4cfd4..83d419439d7 100644 --- a/tests/components/google_tasks/test_todo.py +++ b/tests/components/google_tasks/test_todo.py @@ -1,6 +1,5 @@ """Tests for Google Tasks todo platform.""" - from collections.abc import Awaitable, Callable from http import HTTPStatus import json diff --git a/tests/components/google_travel_time/const.py b/tests/components/google_travel_time/const.py index 844766ceffa..77e99ffbf68 100644 --- a/tests/components/google_travel_time/const.py +++ b/tests/components/google_travel_time/const.py @@ -1,6 +1,5 @@ """Constants for google_travel_time tests.""" - from homeassistant.components.google_travel_time.const import ( CONF_DESTINATION, CONF_ORIGIN, diff --git a/tests/components/govee_ble/__init__.py b/tests/components/govee_ble/__init__.py index c093a6dddb5..60930d1dd0e 100644 --- a/tests/components/govee_ble/__init__.py +++ b/tests/components/govee_ble/__init__.py @@ -1,6 +1,5 @@ """Tests for the Govee BLE integration.""" - from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo NOT_GOVEE_SERVICE_INFO = BluetoothServiceInfo( diff --git a/tests/components/hassio/__init__.py b/tests/components/hassio/__init__.py index 76aecd64098..e5669f777d2 100644 --- a/tests/components/hassio/__init__.py +++ b/tests/components/hassio/__init__.py @@ -1,2 +1,3 @@ """Tests for Hass.io component.""" + SUPERVISOR_TOKEN = "123456" diff --git a/tests/components/hdmi_cec/__init__.py b/tests/components/hdmi_cec/__init__.py index c131bf96b41..31e09489d4a 100644 --- a/tests/components/hdmi_cec/__init__.py +++ b/tests/components/hdmi_cec/__init__.py @@ -1,4 +1,5 @@ """Tests for the HDMI-CEC component.""" + from unittest.mock import AsyncMock, Mock from homeassistant.components.hdmi_cec import KeyPressCommand, KeyReleaseCommand diff --git a/tests/components/homekit_controller/specific_devices/test_cover_that_changes_features.py b/tests/components/homekit_controller/specific_devices/test_cover_that_changes_features.py index 87948c92214..2833346288a 100644 --- a/tests/components/homekit_controller/specific_devices/test_cover_that_changes_features.py +++ b/tests/components/homekit_controller/specific_devices/test_cover_that_changes_features.py @@ -1,6 +1,5 @@ """Test for a Home Assistant bridge that changes cover features at runtime.""" - from homeassistant.components.cover import CoverEntityFeature from homeassistant.const import ATTR_SUPPORTED_FEATURES from homeassistant.core import HomeAssistant diff --git a/tests/components/homekit_controller/specific_devices/test_fan_that_changes_features.py b/tests/components/homekit_controller/specific_devices/test_fan_that_changes_features.py index 9921808c371..aea53e74d46 100644 --- a/tests/components/homekit_controller/specific_devices/test_fan_that_changes_features.py +++ b/tests/components/homekit_controller/specific_devices/test_fan_that_changes_features.py @@ -1,6 +1,5 @@ """Test for a Home Assistant bridge that changes fan features at runtime.""" - from homeassistant.components.fan import FanEntityFeature from homeassistant.const import ATTR_SUPPORTED_FEATURES from homeassistant.core import HomeAssistant diff --git a/tests/components/homekit_controller/specific_devices/test_heater_cooler_that_changes_features.py b/tests/components/homekit_controller/specific_devices/test_heater_cooler_that_changes_features.py index 5d0f63b07ff..e98bed4b0de 100644 --- a/tests/components/homekit_controller/specific_devices/test_heater_cooler_that_changes_features.py +++ b/tests/components/homekit_controller/specific_devices/test_heater_cooler_that_changes_features.py @@ -1,6 +1,5 @@ """Test for a Home Assistant bridge that changes climate features at runtime.""" - from homeassistant.components.climate import ATTR_SWING_MODES, ClimateEntityFeature from homeassistant.const import ATTR_SUPPORTED_FEATURES from homeassistant.core import HomeAssistant diff --git a/tests/components/homekit_controller/specific_devices/test_humidifier_that_changes_value_range.py b/tests/components/homekit_controller/specific_devices/test_humidifier_that_changes_value_range.py index 518bcbbef38..2235b35a9a9 100644 --- a/tests/components/homekit_controller/specific_devices/test_humidifier_that_changes_value_range.py +++ b/tests/components/homekit_controller/specific_devices/test_humidifier_that_changes_value_range.py @@ -1,6 +1,5 @@ """Test for a Home Assistant bridge that changes humidifier min/max at runtime.""" - from homeassistant.components.humidifier import ATTR_MAX_HUMIDITY, ATTR_MIN_HUMIDITY from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er diff --git a/tests/components/homekit_controller/specific_devices/test_light_that_changes_features.py b/tests/components/homekit_controller/specific_devices/test_light_that_changes_features.py index 4e62c75d8f2..d99c1fb2dba 100644 --- a/tests/components/homekit_controller/specific_devices/test_light_that_changes_features.py +++ b/tests/components/homekit_controller/specific_devices/test_light_that_changes_features.py @@ -1,6 +1,5 @@ """Test for a Home Assistant bridge that changes light features at runtime.""" - from homeassistant.components.light import ATTR_SUPPORTED_COLOR_MODES, ColorMode from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er diff --git a/tests/components/honeywell/__init__.py b/tests/components/honeywell/__init__.py index 6299097b104..98fcaa551bf 100644 --- a/tests/components/honeywell/__init__.py +++ b/tests/components/honeywell/__init__.py @@ -1,4 +1,5 @@ """Tests for honeywell component.""" + from unittest.mock import MagicMock from homeassistant.core import HomeAssistant diff --git a/tests/components/http/__init__.py b/tests/components/http/__init__.py index cd1d5916ab8..931af50cbc6 100644 --- a/tests/components/http/__init__.py +++ b/tests/components/http/__init__.py @@ -1,3 +1,4 @@ """Tests for the HTTP component.""" + # Relic from the past. Kept here so we can run negative tests. HTTP_HEADER_HA_AUTH = "X-HA-access" diff --git a/tests/components/http/test_static.py b/tests/components/http/test_static.py index 7f6504bdb7c..d129f6641a5 100644 --- a/tests/components/http/test_static.py +++ b/tests/components/http/test_static.py @@ -1,6 +1,5 @@ """The tests for http static files.""" - from pathlib import Path from aiohttp.test_utils import TestClient diff --git a/tests/components/huisbaasje/test_data.py b/tests/components/huisbaasje/test_data.py index e14976443f3..181dcd7640e 100644 --- a/tests/components/huisbaasje/test_data.py +++ b/tests/components/huisbaasje/test_data.py @@ -1,4 +1,5 @@ """Test data for the tests of the Huisbaasje integration.""" + MOCK_CURRENT_MEASUREMENTS = { "electricity": { "measurement": { diff --git a/tests/components/husqvarna_automower/__init__.py b/tests/components/husqvarna_automower/__init__.py index 069fa0d7372..8c51d69ba3d 100644 --- a/tests/components/husqvarna_automower/__init__.py +++ b/tests/components/husqvarna_automower/__init__.py @@ -1,4 +1,5 @@ """Tests for the Husqvarna Automower integration.""" + from homeassistant.core import HomeAssistant from tests.common import MockConfigEntry diff --git a/tests/components/husqvarna_automower/const.py b/tests/components/husqvarna_automower/const.py index a8b018fa839..dc5893c6749 100644 --- a/tests/components/husqvarna_automower/const.py +++ b/tests/components/husqvarna_automower/const.py @@ -1,4 +1,5 @@ """Constants for Husqvarna Automower tests.""" + CLIENT_ID = "1234" CLIENT_SECRET = "5678" TEST_MOWER_ID = "c7233734-b219-4287-a173-08e3643f89f0" diff --git a/tests/components/hyperion/__init__.py b/tests/components/hyperion/__init__.py index 3714e58479b..72aba96e81f 100644 --- a/tests/components/hyperion/__init__.py +++ b/tests/components/hyperion/__init__.py @@ -1,4 +1,5 @@ """Tests for the Hyperion component.""" + from __future__ import annotations from types import TracebackType diff --git a/tests/components/ibeacon/__init__.py b/tests/components/ibeacon/__init__.py index a18a90f6c3d..b4aa04fd0bb 100644 --- a/tests/components/ibeacon/__init__.py +++ b/tests/components/ibeacon/__init__.py @@ -1,4 +1,5 @@ """Tests for the ibeacon integration.""" + from typing import Any from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo diff --git a/tests/components/image_upload/__init__.py b/tests/components/image_upload/__init__.py index 94acd4a5485..34064e0d40a 100644 --- a/tests/components/image_upload/__init__.py +++ b/tests/components/image_upload/__init__.py @@ -1,4 +1,5 @@ """Tests for the Image Upload integration.""" + import pathlib TEST_IMAGE = pathlib.Path(__file__).parent / "logo.png" diff --git a/tests/components/imap/const.py b/tests/components/imap/const.py index 713261936c7..8ec5e258059 100644 --- a/tests/components/imap/const.py +++ b/tests/components/imap/const.py @@ -1,6 +1,5 @@ """Constants for tests imap integration.""" - DATE_HEADER1 = b"Date: Fri, 24 Mar 2023 13:52:00 +0100\r\n" DATE_HEADER2 = b"Date: Fri, 24 Mar 2023 13:52:00 +0100 (CET)\r\n" DATE_HEADER3 = b"Date: 24 Mar 2023 13:52:00 +0100\r\n" diff --git a/tests/components/inkbird/__init__.py b/tests/components/inkbird/__init__.py index 0a74e50ae0e..30ca369672c 100644 --- a/tests/components/inkbird/__init__.py +++ b/tests/components/inkbird/__init__.py @@ -1,6 +1,5 @@ """Tests for the INKBIRD integration.""" - from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo NOT_INKBIRD_SERVICE_INFO = BluetoothServiceInfo( diff --git a/tests/components/iotawatt/__init__.py b/tests/components/iotawatt/__init__.py index 5f66c145ad6..5233ce6fc83 100644 --- a/tests/components/iotawatt/__init__.py +++ b/tests/components/iotawatt/__init__.py @@ -1,4 +1,5 @@ """Tests for the IoTaWatt integration.""" + from iotawattpy.sensor import Sensor INPUT_SENSOR = Sensor( diff --git a/tests/components/ipma/__init__.py b/tests/components/ipma/__init__.py index 02a61f0b201..65cff43c8d4 100644 --- a/tests/components/ipma/__init__.py +++ b/tests/components/ipma/__init__.py @@ -1,4 +1,5 @@ """Tests for the IPMA component.""" + from collections import namedtuple from datetime import UTC, datetime diff --git a/tests/components/jellyfin/__init__.py b/tests/components/jellyfin/__init__.py index c1f7bbb2f35..7db0ba2d8a3 100644 --- a/tests/components/jellyfin/__init__.py +++ b/tests/components/jellyfin/__init__.py @@ -1,4 +1,5 @@ """Tests for the jellyfin integration.""" + import json from typing import Any diff --git a/tests/components/jewish_calendar/__init__.py b/tests/components/jewish_calendar/__init__.py index f92bfe7d71e..e1352f789ac 100644 --- a/tests/components/jewish_calendar/__init__.py +++ b/tests/components/jewish_calendar/__init__.py @@ -1,4 +1,5 @@ """Tests for the jewish_calendar component.""" + from collections import namedtuple from datetime import datetime diff --git a/tests/components/keenetic_ndms2/__init__.py b/tests/components/keenetic_ndms2/__init__.py index f6bc72cb1e4..8ca91d00386 100644 --- a/tests/components/keenetic_ndms2/__init__.py +++ b/tests/components/keenetic_ndms2/__init__.py @@ -1,4 +1,5 @@ """Tests for the Keenetic NDMS2 component.""" + from homeassistant.components import ssdp from homeassistant.components.keenetic_ndms2 import const from homeassistant.const import ( diff --git a/tests/components/keymitt_ble/__init__.py b/tests/components/keymitt_ble/__init__.py index c6e56739d76..242c1ebe7d6 100644 --- a/tests/components/keymitt_ble/__init__.py +++ b/tests/components/keymitt_ble/__init__.py @@ -1,4 +1,5 @@ """Tests for the MicroBot integration.""" + from unittest.mock import patch from homeassistant.components.bluetooth import BluetoothServiceInfoBleak diff --git a/tests/components/kodi/__init__.py b/tests/components/kodi/__init__.py index bef576dd6bf..a15d1e6681d 100644 --- a/tests/components/kodi/__init__.py +++ b/tests/components/kodi/__init__.py @@ -1,4 +1,5 @@ """Tests for the Kodi integration.""" + from unittest.mock import patch from homeassistant.components.kodi.const import CONF_WS_PORT, DOMAIN diff --git a/tests/components/lamarzocco/test_button.py b/tests/components/lamarzocco/test_button.py index 7d910a57561..e1a036df17a 100644 --- a/tests/components/lamarzocco/test_button.py +++ b/tests/components/lamarzocco/test_button.py @@ -1,6 +1,5 @@ """Tests for the La Marzocco Buttons.""" - from unittest.mock import MagicMock import pytest diff --git a/tests/components/lamarzocco/test_select.py b/tests/components/lamarzocco/test_select.py index a2e4248f0af..3c96f16de9c 100644 --- a/tests/components/lamarzocco/test_select.py +++ b/tests/components/lamarzocco/test_select.py @@ -1,6 +1,5 @@ """Tests for the La Marzocco select entities.""" - from unittest.mock import MagicMock from lmcloud.const import LaMarzoccoModel diff --git a/tests/components/lamarzocco/test_update.py b/tests/components/lamarzocco/test_update.py index 55c5bb0da3d..3b1323d1c73 100644 --- a/tests/components/lamarzocco/test_update.py +++ b/tests/components/lamarzocco/test_update.py @@ -1,6 +1,5 @@ """Tests for the La Marzocco Update Entities.""" - from unittest.mock import MagicMock from lmcloud.const import LaMarzoccoUpdateableComponent diff --git a/tests/components/lastfm/__init__.py b/tests/components/lastfm/__init__.py index 7e6bb6500b2..8f133607c8d 100644 --- a/tests/components/lastfm/__init__.py +++ b/tests/components/lastfm/__init__.py @@ -1,4 +1,5 @@ """The tests for lastfm.""" + from unittest.mock import patch from pylast import PyLastError, Track diff --git a/tests/components/leaone/__init__.py b/tests/components/leaone/__init__.py index c54e07ccd87..3d62314fd9a 100644 --- a/tests/components/leaone/__init__.py +++ b/tests/components/leaone/__init__.py @@ -1,6 +1,5 @@ """Tests for the Leaone integration.""" - from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo SCALE_SERVICE_INFO = BluetoothServiceInfo( diff --git a/tests/components/lifx/__init__.py b/tests/components/lifx/__init__.py index bb798f6f8a0..dc730565cc7 100644 --- a/tests/components/lifx/__init__.py +++ b/tests/components/lifx/__init__.py @@ -1,4 +1,5 @@ """Tests for the lifx integration.""" + from __future__ import annotations import asyncio diff --git a/tests/components/litejet/__init__.py b/tests/components/litejet/__init__.py index 1ba39e46bf3..3116d9e810d 100644 --- a/tests/components/litejet/__init__.py +++ b/tests/components/litejet/__init__.py @@ -1,4 +1,5 @@ """Tests for the litejet component.""" + from homeassistant.components import scene, switch from homeassistant.components.litejet import DOMAIN from homeassistant.const import CONF_PORT diff --git a/tests/components/livisi/__init__.py b/tests/components/livisi/__init__.py index 48a7e21ad8d..c8700aeebc6 100644 --- a/tests/components/livisi/__init__.py +++ b/tests/components/livisi/__init__.py @@ -1,4 +1,5 @@ """Tests for the LIVISI Smart Home integration.""" + from unittest.mock import patch from homeassistant.const import CONF_HOST, CONF_PASSWORD diff --git a/tests/components/lookin/__init__.py b/tests/components/lookin/__init__.py index bfbb5f66887..e19bdc9fd73 100644 --- a/tests/components/lookin/__init__.py +++ b/tests/components/lookin/__init__.py @@ -1,4 +1,5 @@ """Tests for the lookin integration.""" + from __future__ import annotations from ipaddress import ip_address diff --git a/tests/components/lupusec/test_config_flow.py b/tests/components/lupusec/test_config_flow.py index 6b07952ff54..89adedb86cb 100644 --- a/tests/components/lupusec/test_config_flow.py +++ b/tests/components/lupusec/test_config_flow.py @@ -1,4 +1,4 @@ -""""Unit tests for the Lupusec config flow.""" +"""Unit tests for the Lupusec config flow.""" from json import JSONDecodeError from unittest.mock import patch diff --git a/tests/components/lutron_caseta/__init__.py b/tests/components/lutron_caseta/__init__.py index 4e8e2d9a504..c82a0c78ea1 100644 --- a/tests/components/lutron_caseta/__init__.py +++ b/tests/components/lutron_caseta/__init__.py @@ -1,6 +1,5 @@ """Tests for the Lutron Caseta integration.""" - from unittest.mock import patch from homeassistant.components.lutron_caseta import DOMAIN diff --git a/tests/components/lutron_caseta/test_cover.py b/tests/components/lutron_caseta/test_cover.py index 7fe8ed22866..5d45f185aef 100644 --- a/tests/components/lutron_caseta/test_cover.py +++ b/tests/components/lutron_caseta/test_cover.py @@ -1,6 +1,5 @@ """Tests for the Lutron Caseta integration.""" - from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er diff --git a/tests/components/lutron_caseta/test_fan.py b/tests/components/lutron_caseta/test_fan.py index 0147817514d..07744796679 100644 --- a/tests/components/lutron_caseta/test_fan.py +++ b/tests/components/lutron_caseta/test_fan.py @@ -1,6 +1,5 @@ """Tests for the Lutron Caseta integration.""" - from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er diff --git a/tests/components/lutron_caseta/test_light.py b/tests/components/lutron_caseta/test_light.py index cdba9a956e5..5a1568c3cb8 100644 --- a/tests/components/lutron_caseta/test_light.py +++ b/tests/components/lutron_caseta/test_light.py @@ -1,6 +1,5 @@ """Tests for the Lutron Caseta integration.""" - from homeassistant.const import STATE_ON from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er diff --git a/tests/components/medcom_ble/__init__.py b/tests/components/medcom_ble/__init__.py index e38b8ce8f01..aa367b93a14 100644 --- a/tests/components/medcom_ble/__init__.py +++ b/tests/components/medcom_ble/__init__.py @@ -1,4 +1,5 @@ """Tests for the Medcom Inspector BLE integration.""" + from __future__ import annotations from unittest.mock import patch diff --git a/tests/components/media_extractor/__init__.py b/tests/components/media_extractor/__init__.py index d6faa60d3b4..7aac726501b 100644 --- a/tests/components/media_extractor/__init__.py +++ b/tests/components/media_extractor/__init__.py @@ -1,4 +1,5 @@ """The tests for Media Extractor integration.""" + from typing import Any from tests.common import load_json_object_fixture diff --git a/tests/components/met/__init__.py b/tests/components/met/__init__.py index 2ef0f7e12f0..8ea5ce605f0 100644 --- a/tests/components/met/__init__.py +++ b/tests/components/met/__init__.py @@ -1,4 +1,5 @@ """Tests for Met.no.""" + from unittest.mock import patch from homeassistant.components.met.const import CONF_TRACK_HOME, DOMAIN diff --git a/tests/components/met_eireann/__init__.py b/tests/components/met_eireann/__init__.py index 3dfadc06f6b..86c3090b0ca 100644 --- a/tests/components/met_eireann/__init__.py +++ b/tests/components/met_eireann/__init__.py @@ -1,4 +1,5 @@ """Tests for Met Éireann.""" + from unittest.mock import patch from homeassistant.components.met_eireann.const import DOMAIN diff --git a/tests/components/microbees/__init__.py b/tests/components/microbees/__init__.py index a33e1c59f5e..59250efa5ee 100644 --- a/tests/components/microbees/__init__.py +++ b/tests/components/microbees/__init__.py @@ -1,4 +1,5 @@ """Tests for the MicroBees component.""" + from homeassistant.core import HomeAssistant from tests.common import MockConfigEntry diff --git a/tests/components/mikrotik/__init__.py b/tests/components/mikrotik/__init__.py index 8e3d5eda19d..acf5fcb2d5e 100644 --- a/tests/components/mikrotik/__init__.py +++ b/tests/components/mikrotik/__init__.py @@ -1,4 +1,5 @@ """Tests for the Mikrotik component.""" + from __future__ import annotations from typing import Any diff --git a/tests/components/minio/common.py b/tests/components/minio/common.py index 4719fc79e49..107afe7fe8d 100644 --- a/tests/components/minio/common.py +++ b/tests/components/minio/common.py @@ -1,4 +1,5 @@ """Minio Test event.""" + TEST_EVENT = { "Records": [ { diff --git a/tests/components/moat/__init__.py b/tests/components/moat/__init__.py index e0af0229cba..09c4c39d1fa 100644 --- a/tests/components/moat/__init__.py +++ b/tests/components/moat/__init__.py @@ -1,6 +1,5 @@ """Tests for the Moat BLE integration.""" - from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo NOT_MOAT_SERVICE_INFO = BluetoothServiceInfo( diff --git a/tests/components/mobile_app/const.py b/tests/components/mobile_app/const.py index 9316af4a6a2..da80eb07513 100644 --- a/tests/components/mobile_app/const.py +++ b/tests/components/mobile_app/const.py @@ -1,4 +1,5 @@ """Constants for mobile_app tests.""" + CALL_SERVICE = { "type": "call_service", "data": {"domain": "test", "service": "mobile_app", "service_data": {"foo": "bar"}}, diff --git a/tests/components/mopeka/__init__.py b/tests/components/mopeka/__init__.py index 3446b1dc66b..43650349be8 100644 --- a/tests/components/mopeka/__init__.py +++ b/tests/components/mopeka/__init__.py @@ -1,6 +1,5 @@ """Tests for the Mopeka integration.""" - from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo NOT_MOPEKA_SERVICE_INFO = BluetoothServiceInfo( diff --git a/tests/components/motioneye/__init__.py b/tests/components/motioneye/__init__.py index 7558e6fbcc4..183d1b3e6bf 100644 --- a/tests/components/motioneye/__init__.py +++ b/tests/components/motioneye/__init__.py @@ -1,4 +1,5 @@ """Tests for the motionEye integration.""" + from __future__ import annotations from typing import Any diff --git a/tests/components/mystrom/__init__.py b/tests/components/mystrom/__init__.py index acd520cebaa..ac6ac1d8c54 100644 --- a/tests/components/mystrom/__init__.py +++ b/tests/components/mystrom/__init__.py @@ -1,4 +1,5 @@ """Tests for the myStrom integration.""" + from typing import Any diff --git a/tests/components/myuplink/const.py b/tests/components/myuplink/const.py index 6ba324db12a..6001cb151c0 100644 --- a/tests/components/myuplink/const.py +++ b/tests/components/myuplink/const.py @@ -1,3 +1,4 @@ """Constants for myuplink tests.""" + CLIENT_ID = "12345" CLIENT_SECRET = "67890" diff --git a/tests/components/nam/__init__.py b/tests/components/nam/__init__.py index 0f5befcac09..3d95d6cc7e0 100644 --- a/tests/components/nam/__init__.py +++ b/tests/components/nam/__init__.py @@ -1,4 +1,5 @@ """Tests for the Nettigo Air Monitor integration.""" + from unittest.mock import AsyncMock, Mock, patch from homeassistant.components.nam.const import DOMAIN diff --git a/tests/components/nextdns/__init__.py b/tests/components/nextdns/__init__.py index a175bffbb75..d741811acf0 100644 --- a/tests/components/nextdns/__init__.py +++ b/tests/components/nextdns/__init__.py @@ -1,4 +1,5 @@ """Tests for the NextDNS integration.""" + from unittest.mock import patch from nextdns import ( diff --git a/tests/components/nightscout/__init__.py b/tests/components/nightscout/__init__.py index 6c1a34ebe41..3433e889b92 100644 --- a/tests/components/nightscout/__init__.py +++ b/tests/components/nightscout/__init__.py @@ -1,4 +1,5 @@ """Tests for the Nightscout integration.""" + import json from unittest.mock import patch diff --git a/tests/components/nina/__init__.py b/tests/components/nina/__init__.py index d8a70a180dd..923df6b6337 100644 --- a/tests/components/nina/__init__.py +++ b/tests/components/nina/__init__.py @@ -1,4 +1,5 @@ """Tests for the Nina integration.""" + import json from typing import Any diff --git a/tests/components/nzbget/__init__.py b/tests/components/nzbget/__init__.py index 4446ac0cd55..d3216b62ef3 100644 --- a/tests/components/nzbget/__init__.py +++ b/tests/components/nzbget/__init__.py @@ -1,4 +1,5 @@ """Tests for the NZBGet integration.""" + from unittest.mock import patch from homeassistant.components.nzbget.const import DOMAIN diff --git a/tests/components/octoprint/__init__.py b/tests/components/octoprint/__init__.py index 5176d2209b1..d97e4b1ce21 100644 --- a/tests/components/octoprint/__init__.py +++ b/tests/components/octoprint/__init__.py @@ -1,4 +1,5 @@ """Tests for the OctoPrint integration.""" + from __future__ import annotations from typing import Any diff --git a/tests/components/oncue/__init__.py b/tests/components/oncue/__init__.py index 26b08460a93..b90f9df4f89 100644 --- a/tests/components/oncue/__init__.py +++ b/tests/components/oncue/__init__.py @@ -1,4 +1,5 @@ """Tests for the Oncue integration.""" + from contextlib import contextmanager from unittest.mock import patch diff --git a/tests/components/onewire/__init__.py b/tests/components/onewire/__init__.py index 4185337dce2..2929ed3ed50 100644 --- a/tests/components/onewire/__init__.py +++ b/tests/components/onewire/__init__.py @@ -1,4 +1,5 @@ """Tests for 1-Wire integration.""" + from __future__ import annotations from typing import Any diff --git a/tests/components/onvif/__init__.py b/tests/components/onvif/__init__.py index ae48dd26220..5164939eead 100644 --- a/tests/components/onvif/__init__.py +++ b/tests/components/onvif/__init__.py @@ -1,4 +1,5 @@ """Tests for the ONVIF integration.""" + from unittest.mock import AsyncMock, MagicMock, patch from onvif.exceptions import ONVIFError diff --git a/tests/components/opensky/__init__.py b/tests/components/opensky/__init__.py index 0f24f8931af..668416c6dcb 100644 --- a/tests/components/opensky/__init__.py +++ b/tests/components/opensky/__init__.py @@ -1,4 +1,5 @@ """Opensky tests.""" + from unittest.mock import patch from python_opensky import StatesResponse diff --git a/tests/components/otbr/__init__.py b/tests/components/otbr/__init__.py index c839cb0d06e..2c9daa127c2 100644 --- a/tests/components/otbr/__init__.py +++ b/tests/components/otbr/__init__.py @@ -1,4 +1,5 @@ """Tests for the Open Thread Border Router integration.""" + BASE_URL = "http://core-silabs-multiprotocol:8081" CONFIG_ENTRY_DATA_MULTIPAN = {"url": "http://core-silabs-multiprotocol:8081"} CONFIG_ENTRY_DATA_THREAD = {"url": "/dev/ttyAMA1"} diff --git a/tests/components/overkiz/__init__.py b/tests/components/overkiz/__init__.py index 407527b619e..e7d729ea41c 100644 --- a/tests/components/overkiz/__init__.py +++ b/tests/components/overkiz/__init__.py @@ -1,4 +1,5 @@ """Tests for the overkiz component.""" + import humps from pyoverkiz.models import Setup diff --git a/tests/components/persistent_notification/test_init.py b/tests/components/persistent_notification/test_init.py index 921f4b12045..3e99e268231 100644 --- a/tests/components/persistent_notification/test_init.py +++ b/tests/components/persistent_notification/test_init.py @@ -1,6 +1,5 @@ """The tests for the persistent notification component.""" - import homeassistant.components.persistent_notification as pn from homeassistant.components.websocket_api.const import TYPE_RESULT from homeassistant.core import HomeAssistant diff --git a/tests/components/pi_hole/__init__.py b/tests/components/pi_hole/__init__.py index 8295f933d46..38231778624 100644 --- a/tests/components/pi_hole/__init__.py +++ b/tests/components/pi_hole/__init__.py @@ -1,4 +1,5 @@ """Tests for the pi_hole component.""" + from unittest.mock import AsyncMock, MagicMock, patch from hole.exceptions import HoleError diff --git a/tests/components/private_ble_device/test_device_tracker.py b/tests/components/private_ble_device/test_device_tracker.py index 3834254ac7f..9d784ecdfa7 100644 --- a/tests/components/private_ble_device/test_device_tracker.py +++ b/tests/components/private_ble_device/test_device_tracker.py @@ -1,6 +1,5 @@ """Tests for polling measures.""" - import time from habluetooth.advertisement_tracker import ADVERTISING_TIMES_NEEDED diff --git a/tests/components/private_ble_device/test_sensor.py b/tests/components/private_ble_device/test_sensor.py index 15e205c8c86..43667a0e9d2 100644 --- a/tests/components/private_ble_device/test_sensor.py +++ b/tests/components/private_ble_device/test_sensor.py @@ -1,6 +1,5 @@ """Tests for sensors.""" - from habluetooth.advertisement_tracker import ADVERTISING_TIMES_NEEDED from homeassistant.components.bluetooth import async_set_fallback_availability_interval diff --git a/tests/components/qingping/__init__.py b/tests/components/qingping/__init__.py index e06d80e66c5..8b61166f61c 100644 --- a/tests/components/qingping/__init__.py +++ b/tests/components/qingping/__init__.py @@ -1,6 +1,5 @@ """Tests for the Qingping integration.""" - from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo NOT_QINGPING_SERVICE_INFO = BluetoothServiceInfo( diff --git a/tests/components/radarr/__init__.py b/tests/components/radarr/__init__.py index 47204ebf537..0e6f708d329 100644 --- a/tests/components/radarr/__init__.py +++ b/tests/components/radarr/__init__.py @@ -1,4 +1,5 @@ """Tests for the Radarr component.""" + from http import HTTPStatus from unittest.mock import patch diff --git a/tests/components/rainbird/test_binary_sensor.py b/tests/components/rainbird/test_binary_sensor.py index 77ad640e790..83a45de93ff 100644 --- a/tests/components/rainbird/test_binary_sensor.py +++ b/tests/components/rainbird/test_binary_sensor.py @@ -1,6 +1,5 @@ """Tests for rainbird sensor platform.""" - from http import HTTPStatus import pytest diff --git a/tests/components/rainbird/test_calendar.py b/tests/components/rainbird/test_calendar.py index 497a88e4c3c..6258ac56249 100644 --- a/tests/components/rainbird/test_calendar.py +++ b/tests/components/rainbird/test_calendar.py @@ -1,6 +1,5 @@ """Tests for rainbird calendar platform.""" - from collections.abc import Awaitable, Callable import datetime from http import HTTPStatus diff --git a/tests/components/rainforest_eagle/__init__.py b/tests/components/rainforest_eagle/__init__.py index 3d0a51e8452..67d0a3180d4 100644 --- a/tests/components/rainforest_eagle/__init__.py +++ b/tests/components/rainforest_eagle/__init__.py @@ -1,6 +1,5 @@ """Tests for the Rainforest Eagle integration.""" - MOCK_CLOUD_ID = "12345" MOCK_200_RESPONSE_WITH_PRICE = { "zigbee:InstantaneousDemand": { diff --git a/tests/components/refoss/__init__.py b/tests/components/refoss/__init__.py index 34df1b41714..e7c160ef0af 100644 --- a/tests/components/refoss/__init__.py +++ b/tests/components/refoss/__init__.py @@ -1,4 +1,5 @@ """Common helpers for refoss test cases.""" + import asyncio import logging from unittest.mock import AsyncMock, Mock diff --git a/tests/components/renault/__init__.py b/tests/components/renault/__init__.py index 7053bf8df2d..86fddfd5bac 100644 --- a/tests/components/renault/__init__.py +++ b/tests/components/renault/__init__.py @@ -1,4 +1,5 @@ """Tests for the Renault integration.""" + from __future__ import annotations from types import MappingProxyType diff --git a/tests/components/repairs/__init__.py b/tests/components/repairs/__init__.py index 4d584da1706..a6786db9685 100644 --- a/tests/components/repairs/__init__.py +++ b/tests/components/repairs/__init__.py @@ -1,6 +1,5 @@ """Tests for the repairs integration.""" - from homeassistant.core import HomeAssistant from homeassistant.setup import async_setup_component diff --git a/tests/components/roborock/test_vacuum.py b/tests/components/roborock/test_vacuum.py index 61a2ef5d8e2..97a76803b8f 100644 --- a/tests/components/roborock/test_vacuum.py +++ b/tests/components/roborock/test_vacuum.py @@ -1,6 +1,5 @@ """Tests for Roborock vacuums.""" - import copy from typing import Any from unittest.mock import patch diff --git a/tests/components/roku/__init__.py b/tests/components/roku/__init__.py index fc12bb9731d..fe3ef215524 100644 --- a/tests/components/roku/__init__.py +++ b/tests/components/roku/__init__.py @@ -1,4 +1,5 @@ """Tests for the Roku component.""" + from ipaddress import ip_address from homeassistant.components import ssdp, zeroconf diff --git a/tests/components/ruckus_unleashed/__init__.py b/tests/components/ruckus_unleashed/__init__.py index 06ad2352988..97b554b1eb5 100644 --- a/tests/components/ruckus_unleashed/__init__.py +++ b/tests/components/ruckus_unleashed/__init__.py @@ -1,4 +1,5 @@ """Tests for the Ruckus Unleashed integration.""" + from unittest.mock import AsyncMock, patch from aioruckus import AjaxSession, RuckusAjaxApi diff --git a/tests/components/samsungtv/__init__.py b/tests/components/samsungtv/__init__.py index be28d6132ab..f77cd7a9b3e 100644 --- a/tests/components/samsungtv/__init__.py +++ b/tests/components/samsungtv/__init__.py @@ -1,4 +1,5 @@ """Tests for the samsungtv component.""" + from __future__ import annotations from datetime import timedelta diff --git a/tests/components/scrape/__init__.py b/tests/components/scrape/__init__.py index 3d57970a528..de061d051b2 100644 --- a/tests/components/scrape/__init__.py +++ b/tests/components/scrape/__init__.py @@ -1,4 +1,5 @@ """Tests for scrape component.""" + from __future__ import annotations from typing import Any diff --git a/tests/components/screenlogic/__init__.py b/tests/components/screenlogic/__init__.py index ee747a6ca74..c9889e6b4b8 100644 --- a/tests/components/screenlogic/__init__.py +++ b/tests/components/screenlogic/__init__.py @@ -1,4 +1,5 @@ """Tests for the Screenlogic integration.""" + from collections.abc import Callable import logging diff --git a/tests/components/sensibo/__init__.py b/tests/components/sensibo/__init__.py index da585f8d1e8..09a57640472 100644 --- a/tests/components/sensibo/__init__.py +++ b/tests/components/sensibo/__init__.py @@ -1,4 +1,5 @@ """Tests for the Sensibo integration.""" + from __future__ import annotations from homeassistant.const import CONF_API_KEY diff --git a/tests/components/sensor/__init__.py b/tests/components/sensor/__init__.py index 6563041ce99..58e0e8e4c7d 100644 --- a/tests/components/sensor/__init__.py +++ b/tests/components/sensor/__init__.py @@ -1,4 +1,5 @@ """The tests for Sensor platforms.""" + import pytest pytest.register_assert_rewrite("tests.components.recorder.common") diff --git a/tests/components/sensorpro/__init__.py b/tests/components/sensorpro/__init__.py index f92eb700093..da40ff9a3f7 100644 --- a/tests/components/sensorpro/__init__.py +++ b/tests/components/sensorpro/__init__.py @@ -1,6 +1,5 @@ """Tests for the SensorPro integration.""" - from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo NOT_SENSORPRO_SERVICE_INFO = BluetoothServiceInfo( diff --git a/tests/components/sensorpush/__init__.py b/tests/components/sensorpush/__init__.py index c281d4dc086..aae960970dd 100644 --- a/tests/components/sensorpush/__init__.py +++ b/tests/components/sensorpush/__init__.py @@ -1,6 +1,5 @@ """Tests for the SensorPush integration.""" - from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo NOT_SENSOR_PUSH_SERVICE_INFO = BluetoothServiceInfo( diff --git a/tests/components/shelly/__init__.py b/tests/components/shelly/__init__.py index 266e2de4920..2dc9012d863 100644 --- a/tests/components/shelly/__init__.py +++ b/tests/components/shelly/__init__.py @@ -1,4 +1,5 @@ """Tests for the Shelly integration.""" + from collections.abc import Mapping from copy import deepcopy from datetime import timedelta diff --git a/tests/components/shelly/bluetooth/__init__.py b/tests/components/shelly/bluetooth/__init__.py index a4b1f4cdb7e..14588d5762c 100644 --- a/tests/components/shelly/bluetooth/__init__.py +++ b/tests/components/shelly/bluetooth/__init__.py @@ -1,2 +1,3 @@ """Bluetooth tests for Shelly integration.""" + from __future__ import annotations diff --git a/tests/components/simplisafe/common.py b/tests/components/simplisafe/common.py index 68d1c4c94b7..27de1224f36 100644 --- a/tests/components/simplisafe/common.py +++ b/tests/components/simplisafe/common.py @@ -1,4 +1,5 @@ """Define common SimpliSafe test constants/etc.""" + REFRESH_TOKEN = "token123" USERNAME = "user@email.com" USER_ID = "12345" diff --git a/tests/components/slack/__init__.py b/tests/components/slack/__init__.py index 6a258ce9027..acb52a11a6c 100644 --- a/tests/components/slack/__init__.py +++ b/tests/components/slack/__init__.py @@ -1,4 +1,5 @@ """Tests for the Slack integration.""" + from __future__ import annotations import json diff --git a/tests/components/sma/__init__.py b/tests/components/sma/__init__.py index 0c6c8a7ee67..aefb99cf1b1 100644 --- a/tests/components/sma/__init__.py +++ b/tests/components/sma/__init__.py @@ -1,4 +1,5 @@ """Tests for the sma integration.""" + from unittest.mock import patch MOCK_DEVICE = { diff --git a/tests/components/smhi/__init__.py b/tests/components/smhi/__init__.py index 377552da4d5..a0bbf854699 100644 --- a/tests/components/smhi/__init__.py +++ b/tests/components/smhi/__init__.py @@ -1,4 +1,5 @@ """Tests for the SMHI component.""" + ENTITY_ID = "weather.smhi_test" TEST_CONFIG = { "name": "test", diff --git a/tests/components/snooz/__init__.py b/tests/components/snooz/__init__.py index 1e414fb337c..3f04ddbbc03 100644 --- a/tests/components/snooz/__init__.py +++ b/tests/components/snooz/__init__.py @@ -1,4 +1,5 @@ """Tests for the Snooz component.""" + from __future__ import annotations from dataclasses import dataclass diff --git a/tests/components/sonarr/__init__.py b/tests/components/sonarr/__init__.py index ca9fc91bd5e..b6050808a34 100644 --- a/tests/components/sonarr/__init__.py +++ b/tests/components/sonarr/__init__.py @@ -1,4 +1,5 @@ """Tests for the Sonarr component.""" + from homeassistant.const import CONF_API_KEY, CONF_URL MOCK_REAUTH_INPUT = {CONF_API_KEY: "test-api-key-reauth"} diff --git a/tests/components/songpal/__init__.py b/tests/components/songpal/__init__.py index d98ec4175fc..6ebc2ec5ef4 100644 --- a/tests/components/songpal/__init__.py +++ b/tests/components/songpal/__init__.py @@ -1,4 +1,5 @@ """Test the songpal integration.""" + from unittest.mock import AsyncMock, MagicMock, patch from songpal import SongpalException diff --git a/tests/components/sql/__init__.py b/tests/components/sql/__init__.py index 1d3ce0878c3..fc122ad1a95 100644 --- a/tests/components/sql/__init__.py +++ b/tests/components/sql/__init__.py @@ -1,4 +1,5 @@ """Tests for the sql component.""" + from __future__ import annotations from typing import Any diff --git a/tests/components/steam_online/__init__.py b/tests/components/steam_online/__init__.py index 786c5d67782..83fdfdda5de 100644 --- a/tests/components/steam_online/__init__.py +++ b/tests/components/steam_online/__init__.py @@ -1,4 +1,5 @@ """Tests for Steam integration.""" + import random import string from unittest.mock import patch diff --git a/tests/components/steamist/__init__.py b/tests/components/steamist/__init__.py index 8761d675d54..47fa2236849 100644 --- a/tests/components/steamist/__init__.py +++ b/tests/components/steamist/__init__.py @@ -1,4 +1,5 @@ """Tests for the Steamist integration.""" + from __future__ import annotations from contextlib import contextmanager diff --git a/tests/components/streamlabswater/__init__.py b/tests/components/streamlabswater/__init__.py index a467c9553de..f8776708887 100644 --- a/tests/components/streamlabswater/__init__.py +++ b/tests/components/streamlabswater/__init__.py @@ -1,4 +1,5 @@ """Tests for the StreamLabs integration.""" + from homeassistant.core import HomeAssistant from homeassistant.util.unit_system import IMPERIAL_SYSTEM diff --git a/tests/components/switchbot/__init__.py b/tests/components/switchbot/__init__.py index 257501ea196..a5adab4c77f 100644 --- a/tests/components/switchbot/__init__.py +++ b/tests/components/switchbot/__init__.py @@ -1,4 +1,5 @@ """Tests for the switchbot integration.""" + from unittest.mock import patch from homeassistant.components.bluetooth import BluetoothServiceInfoBleak diff --git a/tests/components/switchbot_cloud/__init__.py b/tests/components/switchbot_cloud/__init__.py index 72d23c837ac..ce570499b3a 100644 --- a/tests/components/switchbot_cloud/__init__.py +++ b/tests/components/switchbot_cloud/__init__.py @@ -1,4 +1,5 @@ """Tests for the SwitchBot Cloud integration.""" + from homeassistant.components.switchbot_cloud.const import DOMAIN from homeassistant.const import CONF_API_KEY, CONF_API_TOKEN from homeassistant.core import HomeAssistant diff --git a/tests/components/switcher_kis/__init__.py b/tests/components/switcher_kis/__init__.py index 671af5e11b9..3f08afcbc9f 100644 --- a/tests/components/switcher_kis/__init__.py +++ b/tests/components/switcher_kis/__init__.py @@ -1,4 +1,5 @@ """Test cases and object for the Switcher integration tests.""" + from homeassistant.components.switcher_kis.const import DOMAIN from homeassistant.core import HomeAssistant diff --git a/tests/components/technove/__init__.py b/tests/components/technove/__init__.py index 2d9f639244f..6afffc41e00 100644 --- a/tests/components/technove/__init__.py +++ b/tests/components/technove/__init__.py @@ -1,4 +1,5 @@ """Tests for the TechnoVE integration.""" + from unittest.mock import patch from homeassistant.const import Platform diff --git a/tests/components/tedee/test_sensor.py b/tests/components/tedee/test_sensor.py index 274048082c0..72fbd9cbe8d 100644 --- a/tests/components/tedee/test_sensor.py +++ b/tests/components/tedee/test_sensor.py @@ -1,6 +1,5 @@ """Tests for the Tedee Sensors.""" - from datetime import timedelta from unittest.mock import MagicMock diff --git a/tests/components/thermobeacon/__init__.py b/tests/components/thermobeacon/__init__.py index 1ff1ad20df1..2f7e220ebaa 100644 --- a/tests/components/thermobeacon/__init__.py +++ b/tests/components/thermobeacon/__init__.py @@ -1,6 +1,5 @@ """Tests for the ThermoBeacon integration.""" - from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo NOT_THERMOBEACON_SERVICE_INFO = BluetoothServiceInfo( diff --git a/tests/components/thermopro/__init__.py b/tests/components/thermopro/__init__.py index f66b608f6d3..264e556756c 100644 --- a/tests/components/thermopro/__init__.py +++ b/tests/components/thermopro/__init__.py @@ -1,6 +1,5 @@ """Tests for the ThermoPro integration.""" - from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo NOT_THERMOPRO_SERVICE_INFO = BluetoothServiceInfo( diff --git a/tests/components/tradfri/__init__.py b/tests/components/tradfri/__init__.py index 01b5edf5c44..37792ae7e32 100644 --- a/tests/components/tradfri/__init__.py +++ b/tests/components/tradfri/__init__.py @@ -1,3 +1,4 @@ """Tests for the tradfri component.""" + GATEWAY_ID = "mock-gateway-id" TRADFRI_PATH = "homeassistant.components.tradfri" diff --git a/tests/components/trafikverket_camera/__init__.py b/tests/components/trafikverket_camera/__init__.py index dd23c7bce7e..9eb6c471c1e 100644 --- a/tests/components/trafikverket_camera/__init__.py +++ b/tests/components/trafikverket_camera/__init__.py @@ -1,4 +1,5 @@ """Tests for the Trafikverket Camera integration.""" + from __future__ import annotations from homeassistant.const import CONF_API_KEY, CONF_ID, CONF_LOCATION diff --git a/tests/components/trafikverket_ferry/__init__.py b/tests/components/trafikverket_ferry/__init__.py index 97bedb30281..5f01b1b65ec 100644 --- a/tests/components/trafikverket_ferry/__init__.py +++ b/tests/components/trafikverket_ferry/__init__.py @@ -1,4 +1,5 @@ """Tests for the Trafikverket Ferry integration.""" + from __future__ import annotations from homeassistant.components.trafikverket_ferry.const import ( diff --git a/tests/components/trafikverket_train/__init__.py b/tests/components/trafikverket_train/__init__.py index 9a02ebbf3b6..632f082c73b 100644 --- a/tests/components/trafikverket_train/__init__.py +++ b/tests/components/trafikverket_train/__init__.py @@ -1,4 +1,5 @@ """Tests for the Trafikverket Train integration.""" + from __future__ import annotations from homeassistant.components.trafikverket_ferry.const import ( diff --git a/tests/components/twinkly/__init__.py b/tests/components/twinkly/__init__.py index 4b1411e9223..c77dd0ac963 100644 --- a/tests/components/twinkly/__init__.py +++ b/tests/components/twinkly/__init__.py @@ -1,6 +1,5 @@ """Constants and mock for the twinkly component tests.""" - from aiohttp.client_exceptions import ClientConnectionError from homeassistant.components.twinkly.const import DEV_NAME diff --git a/tests/components/twitch/__init__.py b/tests/components/twitch/__init__.py index 26746c7abb4..ba49390ebdf 100644 --- a/tests/components/twitch/__init__.py +++ b/tests/components/twitch/__init__.py @@ -1,4 +1,5 @@ """Tests for the Twitch component.""" + import asyncio from collections.abc import AsyncGenerator, AsyncIterator from dataclasses import dataclass diff --git a/tests/components/usb/__init__.py b/tests/components/usb/__init__.py index 7dbfdfdcff6..f5f32336931 100644 --- a/tests/components/usb/__init__.py +++ b/tests/components/usb/__init__.py @@ -1,6 +1,5 @@ """Tests for the USB Discovery integration.""" - from homeassistant.components.usb.models import USBDevice conbee_device = USBDevice( diff --git a/tests/components/velbus/const.py b/tests/components/velbus/const.py index 374dbce2529..427ed2e42b7 100644 --- a/tests/components/velbus/const.py +++ b/tests/components/velbus/const.py @@ -1,3 +1,4 @@ """Constants for the Velbus tests.""" + PORT_SERIAL = "/dev/ttyACME100" PORT_TCP = "127.0.1.0.1:3788" diff --git a/tests/components/venstar/__init__.py b/tests/components/venstar/__init__.py index f91f8f28bdf..116a3be0925 100644 --- a/tests/components/venstar/__init__.py +++ b/tests/components/venstar/__init__.py @@ -1,4 +1,5 @@ """Tests for the venstar integration.""" + from requests import RequestException diff --git a/tests/components/version/test_diagnostics.py b/tests/components/version/test_diagnostics.py index 91bbcd3aa9f..9a436aa0740 100644 --- a/tests/components/version/test_diagnostics.py +++ b/tests/components/version/test_diagnostics.py @@ -1,6 +1,5 @@ """Test version diagnostics.""" - from homeassistant.core import HomeAssistant from .common import MOCK_VERSION, setup_version_integration diff --git a/tests/components/vicare/__init__.py b/tests/components/vicare/__init__.py index 8c0f7941ba6..329a3b04d58 100644 --- a/tests/components/vicare/__init__.py +++ b/tests/components/vicare/__init__.py @@ -1,4 +1,5 @@ """Test for ViCare.""" + from __future__ import annotations from typing import Final diff --git a/tests/components/wallbox/const.py b/tests/components/wallbox/const.py index 00ede14771b..452b3af0af8 100644 --- a/tests/components/wallbox/const.py +++ b/tests/components/wallbox/const.py @@ -1,4 +1,5 @@ """Provides constants for Wallbox component tests.""" + JWT = "jwt" USER_ID = "user_id" TTL = "ttl" diff --git a/tests/components/weather/__init__.py b/tests/components/weather/__init__.py index 35a818735d0..c24baad5237 100644 --- a/tests/components/weather/__init__.py +++ b/tests/components/weather/__init__.py @@ -1,6 +1,5 @@ """The tests for Weather platforms.""" - from typing import Any from homeassistant.components.weather import ( diff --git a/tests/components/weatherkit/__init__.py b/tests/components/weatherkit/__init__.py index 5118c44c45b..5450205d579 100644 --- a/tests/components/weatherkit/__init__.py +++ b/tests/components/weatherkit/__init__.py @@ -1,4 +1,5 @@ """Tests for the Apple WeatherKit integration.""" + from unittest.mock import patch from apple_weatherkit import DataSetType diff --git a/tests/components/whirlpool/__init__.py b/tests/components/whirlpool/__init__.py index d47fb5337fd..eda7541ca56 100644 --- a/tests/components/whirlpool/__init__.py +++ b/tests/components/whirlpool/__init__.py @@ -1,4 +1,5 @@ """Tests for the Whirlpool Sixth Sense integration.""" + from homeassistant.components.whirlpool.const import DOMAIN from homeassistant.const import CONF_PASSWORD, CONF_REGION, CONF_USERNAME from homeassistant.core import HomeAssistant diff --git a/tests/components/withings/__init__.py b/tests/components/withings/__init__.py index cd0e9994f74..4b97fc48834 100644 --- a/tests/components/withings/__init__.py +++ b/tests/components/withings/__init__.py @@ -1,4 +1,5 @@ """Tests for the withings component.""" + from dataclasses import dataclass from datetime import timedelta from typing import Any diff --git a/tests/components/wyoming/__init__.py b/tests/components/wyoming/__init__.py index 6b049b04c42..45fff55a89c 100644 --- a/tests/components/wyoming/__init__.py +++ b/tests/components/wyoming/__init__.py @@ -1,4 +1,5 @@ """Tests for the Wyoming integration.""" + import asyncio from unittest.mock import patch diff --git a/tests/components/xiaomi_ble/__init__.py b/tests/components/xiaomi_ble/__init__.py index 197745b70f1..40bd965fd9d 100644 --- a/tests/components/xiaomi_ble/__init__.py +++ b/tests/components/xiaomi_ble/__init__.py @@ -1,6 +1,5 @@ """Tests for the SensorPush integration.""" - from homeassistant.components.bluetooth import BluetoothServiceInfoBleak from tests.components.bluetooth import generate_advertisement_data, generate_ble_device diff --git a/tests/components/xiaomi_miio/__init__.py b/tests/components/xiaomi_miio/__init__.py index 24e66e16b08..ceee4aea744 100644 --- a/tests/components/xiaomi_miio/__init__.py +++ b/tests/components/xiaomi_miio/__init__.py @@ -1,2 +1,3 @@ """Tests for the Xiaomi Miio integration.""" + TEST_MAC = "ab:cd:ef:gh:ij:kl" diff --git a/tests/components/yeelight/__init__.py b/tests/components/yeelight/__init__.py index c7d279220f8..6c940b0b229 100644 --- a/tests/components/yeelight/__init__.py +++ b/tests/components/yeelight/__init__.py @@ -1,4 +1,5 @@ """Tests for the Yeelight integration.""" + from datetime import timedelta from ipaddress import ip_address from unittest.mock import AsyncMock, MagicMock, patch diff --git a/tests/components/youtube/__init__.py b/tests/components/youtube/__init__.py index 665f5f3a762..62808bc7ad9 100644 --- a/tests/components/youtube/__init__.py +++ b/tests/components/youtube/__init__.py @@ -1,4 +1,5 @@ """Tests for the YouTube integration.""" + from collections.abc import AsyncGenerator import json diff --git a/tests/helpers/test_group.py b/tests/helpers/test_group.py index b1300009607..26f4ffda256 100644 --- a/tests/helpers/test_group.py +++ b/tests/helpers/test_group.py @@ -1,6 +1,5 @@ """Test the group helper.""" - from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant from homeassistant.helpers import group diff --git a/tests/ignore_uncaught_exceptions.py b/tests/ignore_uncaught_exceptions.py index e9327c0255a..3be2093057b 100644 --- a/tests/ignore_uncaught_exceptions.py +++ b/tests/ignore_uncaught_exceptions.py @@ -1,4 +1,5 @@ """List of tests that have uncaught exceptions today. Will be shrunk over time.""" + IGNORE_UNCAUGHT_EXCEPTIONS = [ ( # This test explicitly throws an uncaught exception diff --git a/tests/pylint/__init__.py b/tests/pylint/__init__.py index e03a2d2a118..abe4c14c879 100644 --- a/tests/pylint/__init__.py +++ b/tests/pylint/__init__.py @@ -1,4 +1,5 @@ """Tests for pylint.""" + import contextlib from pylint.testutils.unittest_linter import UnittestLinter diff --git a/tests/test_const.py b/tests/test_const.py index b43f677ba8f..5b7cf851fcc 100644 --- a/tests/test_const.py +++ b/tests/test_const.py @@ -1,6 +1,5 @@ """Test const module.""" - from enum import Enum import pytest diff --git a/tests/test_util/__init__.py b/tests/test_util/__init__.py index fe2c2c640e5..dd88af965fe 100644 --- a/tests/test_util/__init__.py +++ b/tests/test_util/__init__.py @@ -1,4 +1,5 @@ """Test utilities.""" + from collections.abc import Awaitable, Callable from aiohttp.web import Application, Request, StreamResponse, middleware diff --git a/tests/testing_config/custom_components/test_embedded/__init__.py b/tests/testing_config/custom_components/test_embedded/__init__.py index 1d861392bf3..b83493817fd 100644 --- a/tests/testing_config/custom_components/test_embedded/__init__.py +++ b/tests/testing_config/custom_components/test_embedded/__init__.py @@ -1,4 +1,5 @@ """Component with embedded platforms.""" + DOMAIN = "test_embedded" diff --git a/tests/testing_config/custom_components/test_integration_platform/__init__.py b/tests/testing_config/custom_components/test_integration_platform/__init__.py index 6b70949231b..220beb05367 100644 --- a/tests/testing_config/custom_components/test_integration_platform/__init__.py +++ b/tests/testing_config/custom_components/test_integration_platform/__init__.py @@ -1,4 +1,5 @@ """Provide a mock package component.""" + from .const import TEST # noqa: F401 DOMAIN = "test_integration_platform" diff --git a/tests/testing_config/custom_components/test_integration_platform/const.py b/tests/testing_config/custom_components/test_integration_platform/const.py index 7e13e04cb47..e55504e7f4f 100644 --- a/tests/testing_config/custom_components/test_integration_platform/const.py +++ b/tests/testing_config/custom_components/test_integration_platform/const.py @@ -1,2 +1,3 @@ """Constants for test_package custom component.""" + TEST = 5 diff --git a/tests/testing_config/custom_components/test_package/__init__.py b/tests/testing_config/custom_components/test_package/__init__.py index 44f62380c92..50e132e2c07 100644 --- a/tests/testing_config/custom_components/test_package/__init__.py +++ b/tests/testing_config/custom_components/test_package/__init__.py @@ -1,4 +1,5 @@ """Provide a mock package component.""" + from .const import TEST # noqa: F401 DOMAIN = "test_package" diff --git a/tests/testing_config/custom_components/test_package/const.py b/tests/testing_config/custom_components/test_package/const.py index 7e13e04cb47..e55504e7f4f 100644 --- a/tests/testing_config/custom_components/test_package/const.py +++ b/tests/testing_config/custom_components/test_package/const.py @@ -1,2 +1,3 @@ """Constants for test_package custom component.""" + TEST = 5 diff --git a/tests/testing_config/custom_components/test_package_loaded_executor/__init__.py b/tests/testing_config/custom_components/test_package_loaded_executor/__init__.py index 44f62380c92..50e132e2c07 100644 --- a/tests/testing_config/custom_components/test_package_loaded_executor/__init__.py +++ b/tests/testing_config/custom_components/test_package_loaded_executor/__init__.py @@ -1,4 +1,5 @@ """Provide a mock package component.""" + from .const import TEST # noqa: F401 DOMAIN = "test_package" diff --git a/tests/testing_config/custom_components/test_package_loaded_executor/const.py b/tests/testing_config/custom_components/test_package_loaded_executor/const.py index 7e13e04cb47..e55504e7f4f 100644 --- a/tests/testing_config/custom_components/test_package_loaded_executor/const.py +++ b/tests/testing_config/custom_components/test_package_loaded_executor/const.py @@ -1,2 +1,3 @@ """Constants for test_package custom component.""" + TEST = 5 diff --git a/tests/testing_config/custom_components/test_package_raises_cancelled_error/__init__.py b/tests/testing_config/custom_components/test_package_raises_cancelled_error/__init__.py index e77df90a00b..37d3becb2d3 100644 --- a/tests/testing_config/custom_components/test_package_raises_cancelled_error/__init__.py +++ b/tests/testing_config/custom_components/test_package_raises_cancelled_error/__init__.py @@ -1,4 +1,5 @@ """Provide a mock package component.""" + import asyncio diff --git a/tests/testing_config/custom_components/test_package_raises_cancelled_error_config_entry/__init__.py b/tests/testing_config/custom_components/test_package_raises_cancelled_error_config_entry/__init__.py index 1283e79f21b..55ce19865c6 100644 --- a/tests/testing_config/custom_components/test_package_raises_cancelled_error_config_entry/__init__.py +++ b/tests/testing_config/custom_components/test_package_raises_cancelled_error_config_entry/__init__.py @@ -1,4 +1,5 @@ """Provide a mock package component.""" + import asyncio diff --git a/tests/testing_config/custom_components/test_standalone.py b/tests/testing_config/custom_components/test_standalone.py index b3acc9917c1..0b7ce8033e5 100644 --- a/tests/testing_config/custom_components/test_standalone.py +++ b/tests/testing_config/custom_components/test_standalone.py @@ -1,4 +1,5 @@ """Provide a mock standalone component.""" + DOMAIN = "test_standalone"