From d0dc80064d57e06f088912fe41f0c46250126745 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Fri, 1 Mar 2024 17:13:14 +0900 Subject: [PATCH] Cleanup: Reformat to satisfy ruff 0.3.0 Ruff pushed all their 2023 experimental changes to stable as a "2024.2" release at end of Feb. So the CI linting broke on 1 Mar. Mostly it seems to be that a blank line is expected between file docstring and imports now. --- custom_components/tuya_local/__init__.py | 1 + custom_components/tuya_local/alarm_control_panel.py | 1 + custom_components/tuya_local/binary_sensor.py | 1 + custom_components/tuya_local/button.py | 1 + custom_components/tuya_local/climate.py | 1 + custom_components/tuya_local/cover.py | 1 + custom_components/tuya_local/diagnostics.py | 1 + custom_components/tuya_local/event.py | 1 + custom_components/tuya_local/fan.py | 1 + custom_components/tuya_local/helpers/config.py | 1 + custom_components/tuya_local/helpers/device_config.py | 1 + custom_components/tuya_local/helpers/mixin.py | 1 + custom_components/tuya_local/humidifier.py | 1 + custom_components/tuya_local/lawn_mower.py | 1 + custom_components/tuya_local/light.py | 1 + custom_components/tuya_local/lock.py | 1 + custom_components/tuya_local/number.py | 1 + custom_components/tuya_local/remote.py | 1 + custom_components/tuya_local/select.py | 1 + custom_components/tuya_local/sensor.py | 1 + custom_components/tuya_local/siren.py | 1 + custom_components/tuya_local/switch.py | 1 + custom_components/tuya_local/vacuum.py | 1 + custom_components/tuya_local/water_heater.py | 1 + tests/devices/test_avatto_blinds.py | 1 + tests/devices/test_avatto_curtain_switch.py | 1 + tests/devices/test_bcom_intercom_camera.py | 1 + tests/devices/test_digoo_dgsp01_dual_nightlight_switch.py | 1 + tests/devices/test_digoo_dgsp202.py | 1 + tests/devices/test_energy_monitoring_powerstrip.py | 1 + tests/devices/test_es01_powerstrip.py | 1 + tests/devices/test_essentials_purifier.py | 1 + tests/devices/test_garage_door_opener.py | 1 + tests/devices/test_grid_connect_double_power_point.py | 1 + tests/devices/test_kogan_garage_door_opener.py | 1 + tests/devices/test_logicom_powerstrip.py | 1 + tests/devices/test_m027_curtain.py | 1 + tests/devices/test_moebot.py | 1 + tests/devices/test_moes_rgb_socket.py | 1 + tests/devices/test_parkside_plgs2012a1_smart_charger.py | 1 + tests/devices/test_pc321ty_energy_meter.py | 1 + tests/devices/test_qoto_03_sprinkler.py | 1 + tests/devices/test_qs_c01_curtain.py | 1 + tests/devices/test_sd123_hpr01_presence.py | 1 + tests/devices/test_simple_blinds.py | 1 + tests/devices/test_simple_switch_with_timer.py | 1 + tests/devices/test_simple_switch_with_timerv2.py | 1 + tests/devices/test_smartplug_encoded.py | 1 + tests/devices/test_smartplugv1.py | 1 + tests/devices/test_smartplugv2.py | 1 + tests/devices/test_smartplugv2_energy.py | 1 + tests/devices/test_tompd63lw_breaker.py | 1 + tests/devices/test_woox_r4028_powerstrip.py | 1 + tests/devices/test_zx_g30_alarm.py | 1 + tests/test_alarm_control_panel.py | 1 + tests/test_binary_sensor.py | 1 + tests/test_button.py | 1 + tests/test_camera.py | 1 + tests/test_climate.py | 1 + tests/test_config_flow.py | 1 + tests/test_cover.py | 1 + tests/test_device_config.py | 1 + tests/test_diagnostics.py | 1 + tests/test_event.py | 1 + tests/test_fan.py | 1 + tests/test_humidifier.py | 1 + tests/test_lawn_mower.py | 1 + tests/test_light.py | 1 + tests/test_lock.py | 1 + tests/test_number.py | 1 + tests/test_remote.py | 1 + tests/test_select.py | 1 + tests/test_sensor.py | 1 + tests/test_siren.py | 1 + tests/test_switch.py | 1 + tests/test_translations.py | 1 + tests/test_vacuum.py | 1 + tests/test_water_heater.py | 1 + util/best_match.py | 1 + util/catalog.py | 1 + util/config_match.py | 1 + util/match_against.py | 1 + 82 files changed, 82 insertions(+) diff --git a/custom_components/tuya_local/__init__.py b/custom_components/tuya_local/__init__.py index 937bd8b441..b5ab97a689 100644 --- a/custom_components/tuya_local/__init__.py +++ b/custom_components/tuya_local/__init__.py @@ -6,6 +6,7 @@ investigation into Goldair's tuyapi statuses https://github.com/codetheweb/tuyapi/issues/31. """ + import logging from homeassistant.config_entries import ConfigEntry diff --git a/custom_components/tuya_local/alarm_control_panel.py b/custom_components/tuya_local/alarm_control_panel.py index dc7fa392d8..f0a74e386d 100644 --- a/custom_components/tuya_local/alarm_control_panel.py +++ b/custom_components/tuya_local/alarm_control_panel.py @@ -1,6 +1,7 @@ """ Setup for different kinds of Tuya alarm control panels. """ + import logging from homeassistant.components.alarm_control_panel import AlarmControlPanelEntity diff --git a/custom_components/tuya_local/binary_sensor.py b/custom_components/tuya_local/binary_sensor.py index d99a62cc6d..d4c33231d1 100644 --- a/custom_components/tuya_local/binary_sensor.py +++ b/custom_components/tuya_local/binary_sensor.py @@ -1,6 +1,7 @@ """ Setup for different kinds of Tuya Binary sensors """ + import logging from homeassistant.components.binary_sensor import ( diff --git a/custom_components/tuya_local/button.py b/custom_components/tuya_local/button.py index fe03e02a08..acaf47187c 100644 --- a/custom_components/tuya_local/button.py +++ b/custom_components/tuya_local/button.py @@ -1,6 +1,7 @@ """ Setup for different kinds of Tuya button devices """ + import logging from homeassistant.components.button import ButtonDeviceClass, ButtonEntity diff --git a/custom_components/tuya_local/climate.py b/custom_components/tuya_local/climate.py index 1fdd4aea57..e202c49121 100644 --- a/custom_components/tuya_local/climate.py +++ b/custom_components/tuya_local/climate.py @@ -1,6 +1,7 @@ """ Setup for different kinds of Tuya climate devices """ + import logging from homeassistant.components.climate import ( diff --git a/custom_components/tuya_local/cover.py b/custom_components/tuya_local/cover.py index 362166f33d..234a6c80a5 100644 --- a/custom_components/tuya_local/cover.py +++ b/custom_components/tuya_local/cover.py @@ -1,6 +1,7 @@ """ Setup for different kinds of Tuya cover devices """ + import logging from homeassistant.components.cover import ( diff --git a/custom_components/tuya_local/diagnostics.py b/custom_components/tuya_local/diagnostics.py index c54c2c4462..cb945a4456 100644 --- a/custom_components/tuya_local/diagnostics.py +++ b/custom_components/tuya_local/diagnostics.py @@ -1,4 +1,5 @@ """Diagnostics support for tuya-local.""" + from __future__ import annotations from typing import Any diff --git a/custom_components/tuya_local/event.py b/custom_components/tuya_local/event.py index fc6ccfd91e..1384982e48 100644 --- a/custom_components/tuya_local/event.py +++ b/custom_components/tuya_local/event.py @@ -1,6 +1,7 @@ """ Implementation of Tuya events """ + import logging from homeassistant.components.event import EventDeviceClass, EventEntity diff --git a/custom_components/tuya_local/fan.py b/custom_components/tuya_local/fan.py index 582465d709..70730bf83a 100644 --- a/custom_components/tuya_local/fan.py +++ b/custom_components/tuya_local/fan.py @@ -1,6 +1,7 @@ """ Setup for different kinds of Tuya fan devices """ + import logging from typing import Any diff --git a/custom_components/tuya_local/helpers/config.py b/custom_components/tuya_local/helpers/config.py index 92d532768d..9f064f1fc5 100644 --- a/custom_components/tuya_local/helpers/config.py +++ b/custom_components/tuya_local/helpers/config.py @@ -1,6 +1,7 @@ """ Helper for general config """ + import logging from .. import DOMAIN diff --git a/custom_components/tuya_local/helpers/device_config.py b/custom_components/tuya_local/helpers/device_config.py index fe4d29e894..eb10776ddb 100644 --- a/custom_components/tuya_local/helpers/device_config.py +++ b/custom_components/tuya_local/helpers/device_config.py @@ -1,6 +1,7 @@ """ Config parser for Tuya Local devices. """ + import logging from base64 import b64decode, b64encode from collections.abc import Sequence diff --git a/custom_components/tuya_local/helpers/mixin.py b/custom_components/tuya_local/helpers/mixin.py index 6a5126fba9..1f9ac95f23 100644 --- a/custom_components/tuya_local/helpers/mixin.py +++ b/custom_components/tuya_local/helpers/mixin.py @@ -1,6 +1,7 @@ """ Mixins to make writing new platforms easier """ + import logging from homeassistant.const import ( diff --git a/custom_components/tuya_local/humidifier.py b/custom_components/tuya_local/humidifier.py index d7e5f59759..39e731db25 100644 --- a/custom_components/tuya_local/humidifier.py +++ b/custom_components/tuya_local/humidifier.py @@ -1,6 +1,7 @@ """ Setup for different kinds of Tuya humidifier devices """ + import logging from homeassistant.components.humidifier import ( diff --git a/custom_components/tuya_local/lawn_mower.py b/custom_components/tuya_local/lawn_mower.py index 3d418b455d..1f4af207ee 100644 --- a/custom_components/tuya_local/lawn_mower.py +++ b/custom_components/tuya_local/lawn_mower.py @@ -1,6 +1,7 @@ """ Setup for different kinds of Tuya lawn mowers """ + from homeassistant.components.lawn_mower import LawnMowerEntity from homeassistant.components.lawn_mower.const import ( SERVICE_DOCK, diff --git a/custom_components/tuya_local/light.py b/custom_components/tuya_local/light.py index 6727a3d096..b9392791f2 100644 --- a/custom_components/tuya_local/light.py +++ b/custom_components/tuya_local/light.py @@ -1,6 +1,7 @@ """ Setup for different kinds of Tuya light devices """ + import logging from struct import pack, unpack diff --git a/custom_components/tuya_local/lock.py b/custom_components/tuya_local/lock.py index f8623e245c..5984817743 100755 --- a/custom_components/tuya_local/lock.py +++ b/custom_components/tuya_local/lock.py @@ -1,6 +1,7 @@ """ Setup for different kinds of Tuya lock devices """ + from homeassistant.components.lock import LockEntity from .device import TuyaLocalDevice diff --git a/custom_components/tuya_local/number.py b/custom_components/tuya_local/number.py index ebb06ca998..3e6137cc29 100644 --- a/custom_components/tuya_local/number.py +++ b/custom_components/tuya_local/number.py @@ -1,6 +1,7 @@ """ Setup for different kinds of Tuya numbers """ + import logging from homeassistant.components.number import NumberEntity diff --git a/custom_components/tuya_local/remote.py b/custom_components/tuya_local/remote.py index b921758006..7ebc83a5fb 100644 --- a/custom_components/tuya_local/remote.py +++ b/custom_components/tuya_local/remote.py @@ -2,6 +2,7 @@ Implementation of Tuya remote control devices Based on broadlink integration for code saving under HA storage """ + import asyncio import json import logging diff --git a/custom_components/tuya_local/select.py b/custom_components/tuya_local/select.py index 84c1059c6e..27185ff7d6 100644 --- a/custom_components/tuya_local/select.py +++ b/custom_components/tuya_local/select.py @@ -1,6 +1,7 @@ """ Setup for different kinds of Tuya selects """ + from homeassistant.components.select import SelectEntity from .device import TuyaLocalDevice diff --git a/custom_components/tuya_local/sensor.py b/custom_components/tuya_local/sensor.py index 6a2e9cdc59..16a093e2f1 100644 --- a/custom_components/tuya_local/sensor.py +++ b/custom_components/tuya_local/sensor.py @@ -1,6 +1,7 @@ """ Setup for different kinds of Tuya sensors """ + import logging from homeassistant.components.sensor import ( diff --git a/custom_components/tuya_local/siren.py b/custom_components/tuya_local/siren.py index e0c17aa05f..d1aef66651 100644 --- a/custom_components/tuya_local/siren.py +++ b/custom_components/tuya_local/siren.py @@ -1,6 +1,7 @@ """ Setup for Tuya siren devices """ + from homeassistant.components.siren import SirenEntity, SirenEntityFeature from homeassistant.components.siren.const import ( ATTR_DURATION, diff --git a/custom_components/tuya_local/switch.py b/custom_components/tuya_local/switch.py index 188892c146..73b6d6a99c 100644 --- a/custom_components/tuya_local/switch.py +++ b/custom_components/tuya_local/switch.py @@ -1,6 +1,7 @@ """ Setup for different kinds of Tuya switch devices """ + from homeassistant.components.switch import SwitchDeviceClass, SwitchEntity from .device import TuyaLocalDevice diff --git a/custom_components/tuya_local/vacuum.py b/custom_components/tuya_local/vacuum.py index 0c0ab756cd..be55c620d3 100644 --- a/custom_components/tuya_local/vacuum.py +++ b/custom_components/tuya_local/vacuum.py @@ -1,6 +1,7 @@ """ Setup for different kinds of Tuya vacuum cleaners """ + from homeassistant.components.vacuum import ( SERVICE_CLEAN_SPOT, SERVICE_RETURN_TO_BASE, diff --git a/custom_components/tuya_local/water_heater.py b/custom_components/tuya_local/water_heater.py index f19526ce99..e4904594e0 100644 --- a/custom_components/tuya_local/water_heater.py +++ b/custom_components/tuya_local/water_heater.py @@ -1,6 +1,7 @@ """ Setup for different kinds of Tuya water heater devices """ + import logging from homeassistant.components.water_heater import ( diff --git a/tests/devices/test_avatto_blinds.py b/tests/devices/test_avatto_blinds.py index ed06439311..d34e2ab2f4 100644 --- a/tests/devices/test_avatto_blinds.py +++ b/tests/devices/test_avatto_blinds.py @@ -1,4 +1,5 @@ """Tests for the Avatto roller blinds controller.""" + from homeassistant.components.cover import CoverDeviceClass, CoverEntityFeature from homeassistant.components.sensor import SensorDeviceClass from homeassistant.const import UnitOfTime diff --git a/tests/devices/test_avatto_curtain_switch.py b/tests/devices/test_avatto_curtain_switch.py index f036538197..77903d11b6 100644 --- a/tests/devices/test_avatto_curtain_switch.py +++ b/tests/devices/test_avatto_curtain_switch.py @@ -1,4 +1,5 @@ """Tests for the Avatto roller blinds controller.""" + from homeassistant.components.cover import CoverDeviceClass, CoverEntityFeature from ..const import AVATTO_CURTAIN_PAYLOAD diff --git a/tests/devices/test_bcom_intercom_camera.py b/tests/devices/test_bcom_intercom_camera.py index 767501a0dd..cd9c0730f9 100644 --- a/tests/devices/test_bcom_intercom_camera.py +++ b/tests/devices/test_bcom_intercom_camera.py @@ -1,4 +1,5 @@ """Tests for the bcom intercom camera""" + from ..const import BCOM_CAMERA_PAYLOAD from .base_device_tests import TuyaDeviceTestCase diff --git a/tests/devices/test_digoo_dgsp01_dual_nightlight_switch.py b/tests/devices/test_digoo_dgsp01_dual_nightlight_switch.py index 5d7e8d2389..addda4a58c 100644 --- a/tests/devices/test_digoo_dgsp01_dual_nightlight_switch.py +++ b/tests/devices/test_digoo_dgsp01_dual_nightlight_switch.py @@ -1,4 +1,5 @@ """Tests for the switch entity.""" + from homeassistant.components.light import ColorMode, LightEntityFeature from homeassistant.components.switch import SwitchDeviceClass diff --git a/tests/devices/test_digoo_dgsp202.py b/tests/devices/test_digoo_dgsp202.py index fb2621aabb..7b88329a75 100644 --- a/tests/devices/test_digoo_dgsp202.py +++ b/tests/devices/test_digoo_dgsp202.py @@ -1,4 +1,5 @@ """Tests for Digoo DSSP202 dual switch with timers and energy monitoring""" + from homeassistant.components.sensor import SensorDeviceClass from homeassistant.components.switch import SwitchDeviceClass from homeassistant.const import ( diff --git a/tests/devices/test_energy_monitoring_powerstrip.py b/tests/devices/test_energy_monitoring_powerstrip.py index 1718b55189..fb2b885450 100644 --- a/tests/devices/test_energy_monitoring_powerstrip.py +++ b/tests/devices/test_energy_monitoring_powerstrip.py @@ -1,4 +1,5 @@ """Tests for the energy monitoring powerstrip.""" + from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorDeviceClass from homeassistant.components.switch import SwitchDeviceClass from homeassistant.const import ( diff --git a/tests/devices/test_es01_powerstrip.py b/tests/devices/test_es01_powerstrip.py index db3e4ebc4d..7df4939757 100644 --- a/tests/devices/test_es01_powerstrip.py +++ b/tests/devices/test_es01_powerstrip.py @@ -1,4 +1,5 @@ """Tests for the ES01 powerstrip.""" + from homeassistant.components.switch import SwitchDeviceClass from homeassistant.const import UnitOfTime diff --git a/tests/devices/test_essentials_purifier.py b/tests/devices/test_essentials_purifier.py index b41389dfc8..ca6e45a0fe 100644 --- a/tests/devices/test_essentials_purifier.py +++ b/tests/devices/test_essentials_purifier.py @@ -1,4 +1,5 @@ """Tests for the essentials air purifier.""" + from homeassistant.components.button import ButtonDeviceClass from homeassistant.components.sensor import SensorDeviceClass from homeassistant.const import ( diff --git a/tests/devices/test_garage_door_opener.py b/tests/devices/test_garage_door_opener.py index 967bbab563..555598aa7f 100644 --- a/tests/devices/test_garage_door_opener.py +++ b/tests/devices/test_garage_door_opener.py @@ -1,4 +1,5 @@ """Tests for the simple garage door opener.""" + from homeassistant.components.cover import CoverDeviceClass, CoverEntityFeature from ..const import SIMPLE_GARAGE_DOOR_PAYLOAD diff --git a/tests/devices/test_grid_connect_double_power_point.py b/tests/devices/test_grid_connect_double_power_point.py index f9265c43b5..33204eaf45 100644 --- a/tests/devices/test_grid_connect_double_power_point.py +++ b/tests/devices/test_grid_connect_double_power_point.py @@ -1,4 +1,5 @@ """Tests for the switch entity.""" + from homeassistant.components.sensor import SensorDeviceClass from homeassistant.components.switch import SwitchDeviceClass from homeassistant.const import ( diff --git a/tests/devices/test_kogan_garage_door_opener.py b/tests/devices/test_kogan_garage_door_opener.py index 422e220098..a13cacf18f 100644 --- a/tests/devices/test_kogan_garage_door_opener.py +++ b/tests/devices/test_kogan_garage_door_opener.py @@ -1,4 +1,5 @@ """Tests for the simple garage door opener.""" + from homeassistant.components.binary_sensor import BinarySensorDeviceClass from homeassistant.components.cover import CoverDeviceClass, CoverEntityFeature from homeassistant.components.sensor import SensorDeviceClass diff --git a/tests/devices/test_logicom_powerstrip.py b/tests/devices/test_logicom_powerstrip.py index a1045a8575..6e040ac557 100644 --- a/tests/devices/test_logicom_powerstrip.py +++ b/tests/devices/test_logicom_powerstrip.py @@ -1,4 +1,5 @@ """Tests for the Logicom Strippy 4-way+USB powerstrip.""" + from homeassistant.components.switch import SwitchDeviceClass from homeassistant.const import UnitOfTime diff --git a/tests/devices/test_m027_curtain.py b/tests/devices/test_m027_curtain.py index e5e8eee593..86f8205724 100644 --- a/tests/devices/test_m027_curtain.py +++ b/tests/devices/test_m027_curtain.py @@ -1,4 +1,5 @@ """Tests for the M027 curtain module.""" + from homeassistant.components.cover import CoverDeviceClass, CoverEntityFeature from homeassistant.const import UnitOfTime diff --git a/tests/devices/test_moebot.py b/tests/devices/test_moebot.py index c930330c31..45f4f390da 100644 --- a/tests/devices/test_moebot.py +++ b/tests/devices/test_moebot.py @@ -3,6 +3,7 @@ Primarily for testing the STOP command which this device is the first to use, and the lawn_mower platform. """ + from homeassistant.components.lawn_mower.const import ( LawnMowerActivity, LawnMowerEntityFeature, diff --git a/tests/devices/test_moes_rgb_socket.py b/tests/devices/test_moes_rgb_socket.py index b02c340554..f010845441 100644 --- a/tests/devices/test_moes_rgb_socket.py +++ b/tests/devices/test_moes_rgb_socket.py @@ -1,4 +1,5 @@ """Tests for the MoesHouse RGB smart socket.""" + from homeassistant.components.light import ColorMode, LightEntityFeature from homeassistant.components.sensor import SensorDeviceClass from homeassistant.components.switch import SwitchDeviceClass diff --git a/tests/devices/test_parkside_plgs2012a1_smart_charger.py b/tests/devices/test_parkside_plgs2012a1_smart_charger.py index 0a3dc05b4b..fc1cc581f6 100644 --- a/tests/devices/test_parkside_plgs2012a1_smart_charger.py +++ b/tests/devices/test_parkside_plgs2012a1_smart_charger.py @@ -1,4 +1,5 @@ """Tests for Parkside PLGS 2012 A1 Smart Charger""" + from homeassistant.components.binary_sensor import BinarySensorDeviceClass from homeassistant.components.number.const import NumberDeviceClass from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorDeviceClass diff --git a/tests/devices/test_pc321ty_energy_meter.py b/tests/devices/test_pc321ty_energy_meter.py index bead314e7e..0e42c3148b 100644 --- a/tests/devices/test_pc321ty_energy_meter.py +++ b/tests/devices/test_pc321ty_energy_meter.py @@ -1,4 +1,5 @@ """Tests for the PC321-TY Power Clamp Energy meter""" + from homeassistant.components.sensor import ( STATE_CLASS_MEASUREMENT, STATE_CLASS_TOTAL_INCREASING, diff --git a/tests/devices/test_qoto_03_sprinkler.py b/tests/devices/test_qoto_03_sprinkler.py index 701a36618c..e04d69711f 100644 --- a/tests/devices/test_qoto_03_sprinkler.py +++ b/tests/devices/test_qoto_03_sprinkler.py @@ -1,4 +1,5 @@ """Tests for the Quto 03 Sprinkler.""" + from homeassistant.components.binary_sensor import BinarySensorDeviceClass from homeassistant.const import PERCENTAGE, UnitOfTime diff --git a/tests/devices/test_qs_c01_curtain.py b/tests/devices/test_qs_c01_curtain.py index 064e9d13d5..caea5cd34d 100644 --- a/tests/devices/test_qs_c01_curtain.py +++ b/tests/devices/test_qs_c01_curtain.py @@ -1,4 +1,5 @@ """Tests for the QS C01 curtain module.""" + from homeassistant.components.cover import CoverDeviceClass, CoverEntityFeature from homeassistant.const import UnitOfTime diff --git a/tests/devices/test_sd123_hpr01_presence.py b/tests/devices/test_sd123_hpr01_presence.py index 42ddb47cf1..ac3602bff5 100644 --- a/tests/devices/test_sd123_hpr01_presence.py +++ b/tests/devices/test_sd123_hpr01_presence.py @@ -1,4 +1,5 @@ """Tests for SD123 Human Presence Radar HPR01""" + from homeassistant.components.binary_sensor import BinarySensorDeviceClass from ..const import SD123_PRESENCE_PAYLOAD diff --git a/tests/devices/test_simple_blinds.py b/tests/devices/test_simple_blinds.py index a2a41457f0..572b53f9e2 100644 --- a/tests/devices/test_simple_blinds.py +++ b/tests/devices/test_simple_blinds.py @@ -1,4 +1,5 @@ """Tests for the simple blinds controller.""" + from homeassistant.components.cover import CoverDeviceClass, CoverEntityFeature from ..const import SIMPLE_BLINDS_PAYLOAD diff --git a/tests/devices/test_simple_switch_with_timer.py b/tests/devices/test_simple_switch_with_timer.py index 53ff72750c..116cb3f7b6 100644 --- a/tests/devices/test_simple_switch_with_timer.py +++ b/tests/devices/test_simple_switch_with_timer.py @@ -1,4 +1,5 @@ """Tests for a simple switch with timer""" + from homeassistant.components.switch import SwitchDeviceClass from homeassistant.const import UnitOfTime diff --git a/tests/devices/test_simple_switch_with_timerv2.py b/tests/devices/test_simple_switch_with_timerv2.py index 66560e4f3b..a967141a6f 100644 --- a/tests/devices/test_simple_switch_with_timerv2.py +++ b/tests/devices/test_simple_switch_with_timerv2.py @@ -1,4 +1,5 @@ """Tests for a simple switch with timer""" + from homeassistant.components.switch import SwitchDeviceClass from homeassistant.const import UnitOfTime diff --git a/tests/devices/test_smartplug_encoded.py b/tests/devices/test_smartplug_encoded.py index 6c55d7be98..c9fdbecadc 100644 --- a/tests/devices/test_smartplug_encoded.py +++ b/tests/devices/test_smartplug_encoded.py @@ -1,4 +1,5 @@ """Tests for the switch entity.""" + from homeassistant.components.switch import SwitchDeviceClass from homeassistant.const import UnitOfTime diff --git a/tests/devices/test_smartplugv1.py b/tests/devices/test_smartplugv1.py index 79c3e6427d..2478ad18c6 100644 --- a/tests/devices/test_smartplugv1.py +++ b/tests/devices/test_smartplugv1.py @@ -1,4 +1,5 @@ """Tests for the switch entity.""" + from homeassistant.components.binary_sensor import BinarySensorDeviceClass from homeassistant.components.sensor import SensorDeviceClass from homeassistant.components.switch import SwitchDeviceClass diff --git a/tests/devices/test_smartplugv2.py b/tests/devices/test_smartplugv2.py index 556230801d..933b7051fc 100644 --- a/tests/devices/test_smartplugv2.py +++ b/tests/devices/test_smartplugv2.py @@ -1,4 +1,5 @@ """Tests for the switch entity.""" + from homeassistant.components.sensor import SensorDeviceClass from homeassistant.components.switch import SwitchDeviceClass from homeassistant.const import ( diff --git a/tests/devices/test_smartplugv2_energy.py b/tests/devices/test_smartplugv2_energy.py index 36a939ebd8..f95f9c0480 100644 --- a/tests/devices/test_smartplugv2_energy.py +++ b/tests/devices/test_smartplugv2_energy.py @@ -1,4 +1,5 @@ """Tests for the switch entity.""" + from homeassistant.components.binary_sensor import BinarySensorDeviceClass from homeassistant.components.sensor import SensorDeviceClass from homeassistant.components.switch import SwitchDeviceClass diff --git a/tests/devices/test_tompd63lw_breaker.py b/tests/devices/test_tompd63lw_breaker.py index 4100c7e13f..d0909984fd 100644 --- a/tests/devices/test_tompd63lw_breaker.py +++ b/tests/devices/test_tompd63lw_breaker.py @@ -1,4 +1,5 @@ """Tests for the switch entity.""" + from homeassistant.components.sensor import SensorDeviceClass from homeassistant.const import ( UnitOfElectricCurrent, diff --git a/tests/devices/test_woox_r4028_powerstrip.py b/tests/devices/test_woox_r4028_powerstrip.py index 279f473369..b1bce20a0c 100644 --- a/tests/devices/test_woox_r4028_powerstrip.py +++ b/tests/devices/test_woox_r4028_powerstrip.py @@ -1,4 +1,5 @@ """Tests for the Woox R4028 powerstrip.""" + from homeassistant.components.switch import SwitchDeviceClass from homeassistant.const import UnitOfTime diff --git a/tests/devices/test_zx_g30_alarm.py b/tests/devices/test_zx_g30_alarm.py index 35857eb17e..bb4a55f34f 100644 --- a/tests/devices/test_zx_g30_alarm.py +++ b/tests/devices/test_zx_g30_alarm.py @@ -1,4 +1,5 @@ """Tests for the ZX G30 Alarm Control Panel.""" + from homeassistant.components.alarm_control_panel import ( AlarmControlPanelEntityFeature as Feature, ) diff --git a/tests/test_alarm_control_panel.py b/tests/test_alarm_control_panel.py index 8decddd1b4..87fd2649b5 100644 --- a/tests/test_alarm_control_panel.py +++ b/tests/test_alarm_control_panel.py @@ -1,4 +1,5 @@ """Tests for the alarm_control_panel entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_binary_sensor.py b/tests/test_binary_sensor.py index 51c1c4cc7c..6a86c9bd6b 100644 --- a/tests/test_binary_sensor.py +++ b/tests/test_binary_sensor.py @@ -1,4 +1,5 @@ """Tests for the binary_sensor entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_button.py b/tests/test_button.py index 4863f29ac5..9b11a3693f 100644 --- a/tests/test_button.py +++ b/tests/test_button.py @@ -1,4 +1,5 @@ """Tests for the button entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_camera.py b/tests/test_camera.py index 95f4a71e2a..c28db1bb55 100644 --- a/tests/test_camera.py +++ b/tests/test_camera.py @@ -1,4 +1,5 @@ """Tests for the camera entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_climate.py b/tests/test_climate.py index 4a9868cfda..27199fd0e5 100644 --- a/tests/test_climate.py +++ b/tests/test_climate.py @@ -1,4 +1,5 @@ """Tests for the light entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_config_flow.py b/tests/test_config_flow.py index d49c02552b..463903e6cb 100644 --- a/tests/test_config_flow.py +++ b/tests/test_config_flow.py @@ -1,4 +1,5 @@ """Tests for the config flow.""" + from unittest.mock import ANY, AsyncMock, MagicMock, patch import pytest diff --git a/tests/test_cover.py b/tests/test_cover.py index acd7af0fac..6732f73fa6 100644 --- a/tests/test_cover.py +++ b/tests/test_cover.py @@ -1,4 +1,5 @@ """Tests for the cover entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_device_config.py b/tests/test_device_config.py index a8fc6ec22d..8a7e30ec82 100644 --- a/tests/test_device_config.py +++ b/tests/test_device_config.py @@ -1,4 +1,5 @@ """Test the config parser""" + from unittest import IsolatedAsyncioTestCase from unittest.mock import MagicMock diff --git a/tests/test_diagnostics.py b/tests/test_diagnostics.py index 7b3e5ccabf..5976a00421 100644 --- a/tests/test_diagnostics.py +++ b/tests/test_diagnostics.py @@ -1,4 +1,5 @@ """Tests for diagnostics platform""" + from unittest.mock import AsyncMock import pytest diff --git a/tests/test_event.py b/tests/test_event.py index 4e3c24b81c..5b7f250170 100644 --- a/tests/test_event.py +++ b/tests/test_event.py @@ -1,4 +1,5 @@ """Tests for the event entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_fan.py b/tests/test_fan.py index 38b8583d24..9e157f4eb0 100644 --- a/tests/test_fan.py +++ b/tests/test_fan.py @@ -1,4 +1,5 @@ """Tests for the fan entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_humidifier.py b/tests/test_humidifier.py index c916588e31..ba2414927f 100644 --- a/tests/test_humidifier.py +++ b/tests/test_humidifier.py @@ -1,4 +1,5 @@ """Tests for the humidifier entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_lawn_mower.py b/tests/test_lawn_mower.py index 6cfd014616..6ab0af7e84 100644 --- a/tests/test_lawn_mower.py +++ b/tests/test_lawn_mower.py @@ -1,4 +1,5 @@ """Tests for the lawn_mower entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_light.py b/tests/test_light.py index cf8c61376b..f332a3bc54 100644 --- a/tests/test_light.py +++ b/tests/test_light.py @@ -1,4 +1,5 @@ """Tests for the light entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_lock.py b/tests/test_lock.py index acbb2df798..1b031b7d01 100644 --- a/tests/test_lock.py +++ b/tests/test_lock.py @@ -1,4 +1,5 @@ """Tests for the lock entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_number.py b/tests/test_number.py index e20df9ccd7..4cdc317422 100644 --- a/tests/test_number.py +++ b/tests/test_number.py @@ -1,4 +1,5 @@ """Tests for the number entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_remote.py b/tests/test_remote.py index 2c3191a72c..8be7476811 100644 --- a/tests/test_remote.py +++ b/tests/test_remote.py @@ -1,4 +1,5 @@ """Tests for the remote entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_select.py b/tests/test_select.py index 4f7885882b..3e1768de6d 100644 --- a/tests/test_select.py +++ b/tests/test_select.py @@ -1,4 +1,5 @@ """Tests for the select entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_sensor.py b/tests/test_sensor.py index d5ada398e5..5bdb620919 100644 --- a/tests/test_sensor.py +++ b/tests/test_sensor.py @@ -1,4 +1,5 @@ """Tests for the sensor entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_siren.py b/tests/test_siren.py index 5d551f4de5..9519cf76b9 100644 --- a/tests/test_siren.py +++ b/tests/test_siren.py @@ -1,4 +1,5 @@ """Tests for the siren entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_switch.py b/tests/test_switch.py index ed03d7bf7d..0a7262d9d4 100644 --- a/tests/test_switch.py +++ b/tests/test_switch.py @@ -1,4 +1,5 @@ """Tests for the switch entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_translations.py b/tests/test_translations.py index 31c3292046..93cd32aeb2 100644 --- a/tests/test_translations.py +++ b/tests/test_translations.py @@ -1,6 +1,7 @@ """ Tests for translation files. """ + from fnmatch import fnmatch from os import walk from os.path import dirname, join diff --git a/tests/test_vacuum.py b/tests/test_vacuum.py index 2740346383..03c71ac8f9 100644 --- a/tests/test_vacuum.py +++ b/tests/test_vacuum.py @@ -1,4 +1,5 @@ """Tests for the vacuum entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/tests/test_water_heater.py b/tests/test_water_heater.py index b6ee97c7bc..d93ed65fe8 100644 --- a/tests/test_water_heater.py +++ b/tests/test_water_heater.py @@ -1,4 +1,5 @@ """Tests for the water heater entity.""" + from unittest.mock import AsyncMock, Mock import pytest diff --git a/util/best_match.py b/util/best_match.py index d43ab62b0b..8f1f50eaf6 100644 --- a/util/best_match.py +++ b/util/best_match.py @@ -1,4 +1,5 @@ """Find matching devices for the supplied dp list""" + import json import sys diff --git a/util/catalog.py b/util/catalog.py index b451c1edbf..8bc9a4597e 100644 --- a/util/catalog.py +++ b/util/catalog.py @@ -5,6 +5,7 @@ The script needs to be run on the version before a potential id changing modification, then again after to compare the two outputs. """ + import sys from custom_components.tuya_local.helpers.device_config import ( diff --git a/util/config_match.py b/util/config_match.py index e0b387fb66..143e4ecf1b 100644 --- a/util/config_match.py +++ b/util/config_match.py @@ -1,4 +1,5 @@ """Find matching devices for the supplied dp list""" + import json import sys diff --git a/util/match_against.py b/util/match_against.py index 94adf602da..2df37ecabe 100644 --- a/util/match_against.py +++ b/util/match_against.py @@ -1,4 +1,5 @@ """Find matching devices for the supplied dp list""" + import json import sys