Ver Fonte

Reformatted using isort & black to match vscode task

Tim Laing há 2 anos atrás
pai
commit
8410111dd5
100 ficheiros alterados com 208 adições e 360 exclusões
  1. 1 1
      custom_components/tuya_local/__init__.py
  2. 3 5
      custom_components/tuya_local/alarm_control_panel.py
  3. 3 2
      custom_components/tuya_local/binary_sensor.py
  4. 1 1
      custom_components/tuya_local/button.py
  5. 3 4
      custom_components/tuya_local/camera.py
  6. 2 2
      custom_components/tuya_local/climate.py
  7. 2 2
      custom_components/tuya_local/config_flow.py
  8. 2 1
      custom_components/tuya_local/cover.py
  9. 2 4
      custom_components/tuya_local/device.py
  10. 3 3
      custom_components/tuya_local/diagnostics.py
  11. 2 5
      custom_components/tuya_local/fan.py
  12. 1 1
      custom_components/tuya_local/helpers/config.py
  13. 2 3
      custom_components/tuya_local/helpers/device_config.py
  14. 1 0
      custom_components/tuya_local/helpers/mixin.py
  15. 3 3
      custom_components/tuya_local/humidifier.py
  16. 4 4
      custom_components/tuya_local/light.py
  17. 1 1
      custom_components/tuya_local/number.py
  18. 3 2
      custom_components/tuya_local/sensor.py
  19. 2 4
      custom_components/tuya_local/siren.py
  20. 1 1
      custom_components/tuya_local/switch.py
  21. 1 0
      custom_components/tuya_local/vacuum.py
  22. 3 2
      custom_components/tuya_local/water_heater.py
  23. 2 0
      setup.cfg
  24. 6 7
      tests/devices/base_device_tests.py
  25. 2 5
      tests/devices/test_arlec_fan_light.py
  26. 1 4
      tests/devices/test_aspen_adv200_fan.py
  27. 2 5
      tests/devices/test_avatto_blinds.py
  28. 2 2
      tests/devices/test_beca_bac002_thermostat.py
  29. 1 4
      tests/devices/test_beca_bhp6000_thermostat.py
  30. 2 2
      tests/devices/test_beca_bht002_thermostat.py
  31. 2 2
      tests/devices/test_beca_bht6000_thermostat.py
  32. 1 4
      tests/devices/test_becool_heatpump.py
  33. 2 5
      tests/devices/test_beok_tr9b_thermostat.py
  34. 2 6
      tests/devices/test_betterlife_bl1500_heater.py
  35. 1 4
      tests/devices/test_carson_cb.py
  36. 2 4
      tests/devices/test_digoo_dgsp01_dual_nightlight_switch.py
  37. 2 2
      tests/devices/test_digoo_dgsp202.py
  38. 1 5
      tests/devices/test_eanons_humidifier.py
  39. 2 2
      tests/devices/test_eberg_cooly_c35hd.py
  40. 5 8
      tests/devices/test_eberg_qubo_q40hd_heatpump.py
  41. 2 8
      tests/devices/test_ecostrad_accentiq_heater.py
  42. 1 1
      tests/devices/test_energy_monitoring_powerstrip.py
  43. 1 4
      tests/devices/test_eurom_600_heater.py
  44. 1 4
      tests/devices/test_eurom_600v2_heater.py
  45. 2 2
      tests/devices/test_eurom_601_heater.py
  46. 2 2
      tests/devices/test_fersk_vind_2_climate.py
  47. 1 4
      tests/devices/test_garage_door_opener.py
  48. 1 3
      tests/devices/test_goldair_fan.py
  49. 2 5
      tests/devices/test_goldair_geco_heater.py
  50. 2 5
      tests/devices/test_goldair_gpph_heater.py
  51. 1 1
      tests/devices/test_grid_connect_double_power_point.py
  52. 2 8
      tests/devices/test_himox_h05_purifier.py
  53. 1 4
      tests/devices/test_himox_h06_purifier.py
  54. 1 1
      tests/devices/test_hydrotherm_dynamicx8.py
  55. 1 1
      tests/devices/test_immax_neo_light_vento.py
  56. 2 6
      tests/devices/test_inkbird_itc308_thermostat.py
  57. 1 1
      tests/devices/test_inkbird_sousvide.py
  58. 4 12
      tests/devices/test_jiahong_et72w_thermostat.py
  59. 1 4
      tests/devices/test_kogan_garage_door_opener.py
  60. 1 3
      tests/devices/test_kogan_glass_1_7l_kettle.py
  61. 1 4
      tests/devices/test_kogan_kawfpac09ya_airconditioner.py
  62. 1 5
      tests/devices/test_kyvol_e30_vacuum.py
  63. 1 4
      tests/devices/test_lefant_m213_vacuum.py
  64. 2 5
      tests/devices/test_m027_curtain.py
  65. 2 2
      tests/devices/test_moes_bht002_thermostat.py
  66. 2 5
      tests/devices/test_moes_rgb_socket.py
  67. 1 1
      tests/devices/test_moes_temp_humidity.py
  68. 2 7
      tests/devices/test_nashone_mts700wb_thermostat.py
  69. 3 3
      tests/devices/test_nedis_htpl20f_heater.py
  70. 5 7
      tests/devices/test_parkside_plgs2012a1_smart_charger.py
  71. 2 2
      tests/devices/test_pc321ty_energy_meter.py
  72. 1 4
      tests/devices/test_poiema_one_purifier.py
  73. 1 4
      tests/devices/test_poolex_qline_heatpump.py
  74. 1 4
      tests/devices/test_qs_c01_curtain.py
  75. 1 4
      tests/devices/test_rgbcw_lightbulb.py
  76. 1 4
      tests/devices/test_simple_blinds.py
  77. 1 3
      tests/devices/test_smartplug_encoded.py
  78. 2 2
      tests/devices/test_smartplugv1.py
  79. 1 1
      tests/devices/test_smartplugv2.py
  80. 1 1
      tests/devices/test_smartplugv2_energy.py
  81. 1 3
      tests/devices/test_starlight_heatpump.py
  82. 2 3
      tests/devices/test_tmwf02_fan.py
  83. 1 1
      tests/devices/test_tompd63lw_breaker.py
  84. 1 4
      tests/devices/test_vork_vk6067aw_purifier.py
  85. 1 4
      tests/devices/test_weau_pool_heatpumpv2.py
  86. 1 3
      tests/devices/test_wetair_wawh1210lw_humidifier.py
  87. 4 4
      tests/devices/test_wetair_wch750_heater.py
  88. 1 5
      tests/devices/test_wilfa_haze_hu400bc_humidifier.py
  89. 1 0
      tests/mixins/climate.py
  90. 1 3
      tests/mixins/light.py
  91. 7 6
      tests/test_alarm_control_panel.py
  92. 7 6
      tests/test_binary_sensor.py
  93. 4 6
      tests/test_button.py
  94. 4 6
      tests/test_camera.py
  95. 4 3
      tests/test_climate.py
  96. 4 5
      tests/test_config_flow.py
  97. 5 4
      tests/test_cover.py
  98. 3 8
      tests/test_device.py
  99. 6 9
      tests/test_device_config.py
  100. 4 4
      tests/test_diagnostics.py

+ 1 - 1
custom_components/tuya_local/__init__.py

@@ -22,7 +22,7 @@ from .const import (
     CONF_TYPE,
     DOMAIN,
 )
-from .device import setup_device, get_device_id, async_delete_device
+from .device import async_delete_device, get_device_id, setup_device
 from .helpers.device_config import get_config
 
 _LOGGER = logging.getLogger(__name__)

+ 3 - 5
custom_components/tuya_local/alarm_control_panel.py

@@ -1,9 +1,9 @@
 """
 Setup for different kinds of Tuya alarm control panels.
 """
-from homeassistant.components.alarm_control_panel import (
-    AlarmControlPanelEntity,
-)
+import logging
+
+from homeassistant.components.alarm_control_panel import AlarmControlPanelEntity
 from homeassistant.components.alarm_control_panel.const import (
     AlarmControlPanelEntityFeature as Feature,
 )
@@ -17,8 +17,6 @@ from homeassistant.const import (
     STATE_ALARM_TRIGGERED,
 )
 
-import logging
-
 from .device import TuyaLocalDevice
 from .helpers.config import async_tuya_setup_platform
 from .helpers.device_config import TuyaEntityConfig

+ 3 - 2
custom_components/tuya_local/binary_sensor.py

@@ -1,11 +1,12 @@
 """
 Setup for different kinds of Tuya Binary sensors
 """
+import logging
+
 from homeassistant.components.binary_sensor import (
-    BinarySensorEntity,
     BinarySensorDeviceClass,
+    BinarySensorEntity,
 )
-import logging
 
 from .device import TuyaLocalDevice
 from .helpers.config import async_tuya_setup_platform

+ 1 - 1
custom_components/tuya_local/button.py

@@ -3,7 +3,7 @@ Setup for different kinds of Tuya button devices
 """
 import logging
 
-from homeassistant.components.button import ButtonEntity, ButtonDeviceClass
+from homeassistant.components.button import ButtonDeviceClass, ButtonEntity
 
 from .device import TuyaLocalDevice
 from .helpers.config import async_tuya_setup_platform

+ 3 - 4
custom_components/tuya_local/camera.py

@@ -2,12 +2,11 @@
 Platform for Tuya Cameras
 """
 
-from homeassistant.components.camera import (
-    Camera as CameraEntity,
-    CameraEntityFeature,
-)
 import logging
 
+from homeassistant.components.camera import Camera as CameraEntity
+from homeassistant.components.camera import CameraEntityFeature
+
 from .device import TuyaLocalDevice
 from .helpers.config import async_tuya_setup_platform
 from .helpers.device_config import TuyaEntityConfig

+ 2 - 2
custom_components/tuya_local/climate.py

@@ -1,6 +1,8 @@
 """
 Setup for different kinds of Tuya climate devices
 """
+import logging
+
 from homeassistant.components.climate import (
     ClimateEntity,
     ClimateEntityFeature,
@@ -30,8 +32,6 @@ from homeassistant.const import (
     PRECISION_WHOLE,
     UnitOfTemperature,
 )
-import logging
-
 
 from .device import TuyaLocalDevice
 from .helpers.config import async_tuya_setup_platform

+ 2 - 2
custom_components/tuya_local/config_flow.py

@@ -7,16 +7,16 @@ from homeassistant.const import CONF_HOST, CONF_NAME
 from homeassistant.core import HomeAssistant, callback
 
 from . import DOMAIN
-from .device import TuyaLocalDevice
 from .const import (
     API_PROTOCOL_VERSIONS,
+    CONF_DEVICE_CID,
     CONF_DEVICE_ID,
     CONF_LOCAL_KEY,
     CONF_POLL_ONLY,
-    CONF_DEVICE_CID,
     CONF_PROTOCOL_VERSION,
     CONF_TYPE,
 )
+from .device import TuyaLocalDevice
 from .helpers.config import get_device_id
 from .helpers.device_config import get_config
 from .helpers.log import log_json

+ 2 - 1
custom_components/tuya_local/cover.py

@@ -1,12 +1,13 @@
 """
 Setup for different kinds of Tuya cover devices
 """
+import logging
+
 from homeassistant.components.cover import (
     CoverDeviceClass,
     CoverEntity,
     CoverEntityFeature,
 )
-import logging
 
 from .device import TuyaLocalDevice
 from .helpers.config import async_tuya_setup_platform

+ 2 - 4
custom_components/tuya_local/device.py

@@ -4,11 +4,10 @@ API for Tuya Local devices.
 
 import asyncio
 import logging
-import tinytuya
 from threading import Lock
 from time import time
 
-
+import tinytuya
 from homeassistant.const import (
     CONF_HOST,
     CONF_NAME,
@@ -19,18 +18,17 @@ from homeassistant.core import HomeAssistant
 
 from .const import (
     API_PROTOCOL_VERSIONS,
+    CONF_DEVICE_CID,
     CONF_DEVICE_ID,
     CONF_LOCAL_KEY,
     CONF_POLL_ONLY,
     CONF_PROTOCOL_VERSION,
     DOMAIN,
-    CONF_DEVICE_CID,
 )
 from .helpers.config import get_device_id
 from .helpers.device_config import possible_matches
 from .helpers.log import log_json
 
-
 _LOGGER = logging.getLogger(__name__)
 
 

+ 3 - 3
custom_components/tuya_local/diagnostics.py

@@ -6,17 +6,17 @@ from typing import Any
 from homeassistant.components.diagnostics import REDACTED
 from homeassistant.config_entries import ConfigEntry
 from homeassistant.core import HomeAssistant, callback
-from homeassistant.helpers import device_registry as dr, entity_registry as er
+from homeassistant.helpers import device_registry as dr
+from homeassistant.helpers import entity_registry as er
 from homeassistant.helpers.device_registry import DeviceEntry
-
 from tinytuya import __version__ as tinytuya_version
 
 from .const import (
     API_PROTOCOL_VERSIONS,
+    CONF_DEVICE_CID,
     CONF_PROTOCOL_VERSION,
     CONF_TYPE,
     DOMAIN,
-    CONF_DEVICE_CID,
 )
 from .device import TuyaLocalDevice
 from .helpers.config import get_device_id

+ 2 - 5
custom_components/tuya_local/fan.py

@@ -1,18 +1,15 @@
 """
 Setup for different kinds of Tuya fan devices
 """
-from homeassistant.components.fan import (
-    FanEntity,
-    FanEntityFeature,
-)
 import logging
 
+from homeassistant.components.fan import FanEntity, FanEntityFeature
+
 from .device import TuyaLocalDevice
 from .helpers.config import async_tuya_setup_platform
 from .helpers.device_config import TuyaEntityConfig
 from .helpers.mixin import TuyaLocalEntity
 
-
 _LOGGER = logging.getLogger(__name__)
 
 

+ 1 - 1
custom_components/tuya_local/helpers/config.py

@@ -4,7 +4,7 @@ Helper for general config
 import logging
 
 from .. import DOMAIN
-from ..const import CONF_DEVICE_ID, CONF_DEVICE_CID, CONF_TYPE
+from ..const import CONF_DEVICE_CID, CONF_DEVICE_ID, CONF_TYPE
 from .device_config import get_config
 
 _LOGGER = logging.getLogger(__name__)

+ 2 - 3
custom_components/tuya_local/helpers/device_config.py

@@ -1,14 +1,13 @@
 """
 Config parser for Tuya Local devices.
 """
+import logging
 from base64 import b64decode, b64encode
-
 from collections.abc import Sequence
 from fnmatch import fnmatch
-import logging
 from numbers import Number
 from os import walk
-from os.path import join, dirname, splitext, exists
+from os.path import dirname, exists, join, splitext
 
 from homeassistant.util import slugify
 from homeassistant.util.yaml import load_yaml

+ 1 - 0
custom_components/tuya_local/helpers/mixin.py

@@ -2,6 +2,7 @@
 Mixins to make writing new platforms easier
 """
 import logging
+
 from homeassistant.const import (
     AREA_SQUARE_METERS,
     CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,

+ 3 - 3
custom_components/tuya_local/humidifier.py

@@ -1,22 +1,22 @@
 """
 Setup for different kinds of Tuya humidifier devices
 """
+import logging
+
 from homeassistant.components.humidifier import (
     HumidifierDeviceClass,
     HumidifierEntity,
     HumidifierEntityFeature,
 )
-
 from homeassistant.components.humidifier.const import (
     DEFAULT_MAX_HUMIDITY,
     DEFAULT_MIN_HUMIDITY,
 )
-import logging
 
 from .device import TuyaLocalDevice
+from .helpers.config import async_tuya_setup_platform
 from .helpers.device_config import TuyaEntityConfig
 from .helpers.mixin import TuyaLocalEntity
-from .helpers.config import async_tuya_setup_platform
 
 _LOGGER = logging.getLogger(__name__)
 

+ 4 - 4
custom_components/tuya_local/light.py

@@ -1,6 +1,10 @@
 """
 Setup for different kinds of Tuya light devices
 """
+import logging
+from struct import pack, unpack
+
+import homeassistant.util.color as color_util
 from homeassistant.components.light import (
     ATTR_BRIGHTNESS,
     ATTR_COLOR_TEMP,
@@ -11,10 +15,6 @@ from homeassistant.components.light import (
     LightEntity,
     LightEntityFeature,
 )
-import homeassistant.util.color as color_util
-
-import logging
-from struct import pack, unpack
 
 from .device import TuyaLocalDevice
 from .helpers.config import async_tuya_setup_platform

+ 1 - 1
custom_components/tuya_local/number.py

@@ -5,8 +5,8 @@ import logging
 
 from homeassistant.components.number import NumberEntity
 from homeassistant.components.number.const import (
-    DEFAULT_MIN_VALUE,
     DEFAULT_MAX_VALUE,
+    DEFAULT_MIN_VALUE,
     NumberDeviceClass,
 )
 

+ 3 - 2
custom_components/tuya_local/sensor.py

@@ -1,12 +1,13 @@
 """
 Setup for different kinds of Tuya sensors
 """
+import logging
+
 from homeassistant.components.sensor import (
+    STATE_CLASSES,
     SensorDeviceClass,
     SensorEntity,
-    STATE_CLASSES,
 )
-import logging
 
 from .device import TuyaLocalDevice
 from .helpers.config import async_tuya_setup_platform

+ 2 - 4
custom_components/tuya_local/siren.py

@@ -1,15 +1,13 @@
 """
 Setup for Tuya siren devices
 """
-from homeassistant.components.siren import (
-    SirenEntity,
-    SirenEntityFeature,
-)
+from homeassistant.components.siren import SirenEntity, SirenEntityFeature
 from homeassistant.components.siren.const import (
     ATTR_DURATION,
     ATTR_TONE,
     ATTR_VOLUME_LEVEL,
 )
+
 from .device import TuyaLocalDevice
 from .helpers.config import async_tuya_setup_platform
 from .helpers.device_config import TuyaEntityConfig

+ 1 - 1
custom_components/tuya_local/switch.py

@@ -1,7 +1,7 @@
 """
 Setup for different kinds of Tuya switch devices
 """
-from homeassistant.components.switch import SwitchEntity, SwitchDeviceClass
+from homeassistant.components.switch import SwitchDeviceClass, SwitchEntity
 
 from .device import TuyaLocalDevice
 from .helpers.config import async_tuya_setup_platform

+ 1 - 0
custom_components/tuya_local/vacuum.py

@@ -14,6 +14,7 @@ from homeassistant.components.vacuum import (
     StateVacuumEntity,
     VacuumEntityFeature,
 )
+
 from .device import TuyaLocalDevice
 from .helpers.config import async_tuya_setup_platform
 from .helpers.device_config import TuyaEntityConfig

+ 3 - 2
custom_components/tuya_local/water_heater.py

@@ -1,15 +1,16 @@
 """
 Setup for different kinds of Tuya water heater devices
 """
+import logging
+
 from homeassistant.components.water_heater import (
+    ATTR_AWAY_MODE,
     ATTR_CURRENT_TEMPERATURE,
     ATTR_OPERATION_MODE,
-    ATTR_AWAY_MODE,
     WaterHeaterEntity,
     WaterHeaterEntityFeature,
 )
 from homeassistant.const import ATTR_TEMPERATURE, UnitOfTemperature
-import logging
 
 from .device import TuyaLocalDevice
 from .helpers.config import async_tuya_setup_platform

+ 2 - 0
setup.cfg

@@ -0,0 +1,2 @@
+[isort]
+profile=black

+ 6 - 7
tests/devices/base_device_tests.py

@@ -1,16 +1,20 @@
 from unittest import IsolatedAsyncioTestCase
-from unittest.mock import AsyncMock, patch, PropertyMock
+from unittest.mock import AsyncMock, PropertyMock, patch
 from uuid import uuid4
 
 from homeassistant.helpers.entity import EntityCategory
 
-from custom_components.tuya_local.binary_sensor import TuyaLocalBinarySensor
 from custom_components.tuya_local.alarm_control_panel import TuyaLocalAlarmControlPanel
+from custom_components.tuya_local.binary_sensor import TuyaLocalBinarySensor
 from custom_components.tuya_local.button import TuyaLocalButton
 from custom_components.tuya_local.camera import TuyaLocalCamera
 from custom_components.tuya_local.climate import TuyaLocalClimate
 from custom_components.tuya_local.cover import TuyaLocalCover
 from custom_components.tuya_local.fan import TuyaLocalFan
+from custom_components.tuya_local.helpers.device_config import (
+    TuyaDeviceConfig,
+    possible_matches,
+)
 from custom_components.tuya_local.humidifier import TuyaLocalHumidifier
 from custom_components.tuya_local.light import TuyaLocalLight
 from custom_components.tuya_local.lock import TuyaLocalLock
@@ -22,11 +26,6 @@ from custom_components.tuya_local.switch import TuyaLocalSwitch
 from custom_components.tuya_local.vacuum import TuyaLocalVacuum
 from custom_components.tuya_local.water_heater import TuyaLocalWaterHeater
 
-from custom_components.tuya_local.helpers.device_config import (
-    TuyaDeviceConfig,
-    possible_matches,
-)
-
 DEVICE_TYPES = {
     "alarm_control_panel": TuyaLocalAlarmControlPanel,
     "binary_sensor": TuyaLocalBinarySensor,

+ 2 - 5
tests/devices/test_arlec_fan_light.py

@@ -3,11 +3,8 @@ from homeassistant.components.fan import (
     DIRECTION_REVERSE,
     FanEntityFeature,
 )
-from homeassistant.components.light import (
-    ATTR_BRIGHTNESS,
-    ATTR_COLOR_TEMP,
-    ColorMode,
-)
+from homeassistant.components.light import ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ColorMode
+
 from ..const import ARLEC_FAN_LIGHT_PAYLOAD
 from ..helpers import assert_device_properties_set
 from ..mixins.select import BasicSelectTests

+ 1 - 4
tests/devices/test_aspen_adv200_fan.py

@@ -1,7 +1,4 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
+from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
 from homeassistant.components.fan import (
     DIRECTION_FORWARD,
     DIRECTION_REVERSE,

+ 2 - 5
tests/devices/test_avatto_blinds.py

@@ -1,15 +1,12 @@
 """Tests for the Avatto roller blinds controller."""
-from homeassistant.components.cover import (
-    CoverDeviceClass,
-    CoverEntityFeature,
-)
+from homeassistant.components.cover import CoverDeviceClass, CoverEntityFeature
 from homeassistant.components.sensor import SensorDeviceClass
 from homeassistant.const import UnitOfTime
 
 from ..const import AVATTO_BLINDS_PAYLOAD
 from ..helpers import assert_device_properties_set
-from ..mixins.sensor import MultiSensorTests
 from ..mixins.select import BasicSelectTests
+from ..mixins.sensor import MultiSensorTests
 from .base_device_tests import TuyaDeviceTestCase
 
 COMMAND_DP = "1"

+ 2 - 2
tests/devices/test_beca_bac002_thermostat.py

@@ -1,12 +1,12 @@
 from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
     FAN_AUTO,
     FAN_HIGH,
     FAN_LOW,
     FAN_MEDIUM,
-    HVACMode,
     PRESET_COMFORT,
     PRESET_ECO,
+    ClimateEntityFeature,
+    HVACMode,
 )
 from homeassistant.const import PRECISION_TENTHS, UnitOfTemperature
 

+ 1 - 4
tests/devices/test_beca_bhp6000_thermostat.py

@@ -1,7 +1,4 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
+from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
 from homeassistant.const import UnitOfTemperature
 
 from ..const import BECA_BHP6000_PAYLOAD

+ 2 - 2
tests/devices/test_beca_bht002_thermostat.py

@@ -1,8 +1,8 @@
 from homeassistant.components.climate.const import (
+    PRESET_COMFORT,
+    PRESET_ECO,
     ClimateEntityFeature,
     HVACMode,
-    PRESET_ECO,
-    PRESET_COMFORT,
 )
 from homeassistant.components.sensor import SensorDeviceClass
 from homeassistant.const import UnitOfTemperature

+ 2 - 2
tests/devices/test_beca_bht6000_thermostat.py

@@ -1,8 +1,8 @@
 from homeassistant.components.climate.const import (
+    PRESET_COMFORT,
+    PRESET_ECO,
     ClimateEntityFeature,
     HVACMode,
-    PRESET_ECO,
-    PRESET_COMFORT,
 )
 from homeassistant.components.sensor import SensorDeviceClass
 from homeassistant.const import UnitOfTemperature

+ 1 - 4
tests/devices/test_becool_heatpump.py

@@ -1,7 +1,4 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
+from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
 from homeassistant.const import UnitOfTemperature
 
 from ..const import BECOOL_HEATPUMP_PAYLOAD

+ 2 - 5
tests/devices/test_beok_tr9b_thermostat.py

@@ -1,14 +1,11 @@
 from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
+from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
 from homeassistant.components.number.const import NumberDeviceClass
 from homeassistant.const import PRECISION_TENTHS, UnitOfTemperature
 
 from ..const import BEOK_TR9B_PAYLOAD
-from ..mixins.climate import TargetTemperatureTests
 from ..mixins.binary_sensor import MultiBinarySensorTests
+from ..mixins.climate import TargetTemperatureTests
 from ..mixins.lock import BasicLockTests
 from ..mixins.number import MultiNumberTests
 from ..mixins.select import MultiSelectTests

+ 2 - 6
tests/devices/test_betterlife_bl1500_heater.py

@@ -1,9 +1,6 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
+from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
 from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import UnitOfTime, UnitOfTemperature
+from homeassistant.const import UnitOfTemperature, UnitOfTime
 
 from ..const import BETTERLIFE_BL1500_PAYLOAD
 from ..helpers import assert_device_properties_set
@@ -11,7 +8,6 @@ from ..mixins.climate import TargetTemperatureTests
 from ..mixins.lock import BasicLockTests
 from ..mixins.select import BasicSelectTests
 from ..mixins.sensor import BasicSensorTests
-
 from .base_device_tests import TuyaDeviceTestCase
 
 HVACMODE_DPS = "1"

+ 1 - 4
tests/devices/test_carson_cb.py

@@ -1,7 +1,4 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
+from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
 from homeassistant.const import UnitOfTemperature
 
 from ..const import CARSON_CB_PAYLOAD

+ 2 - 4
tests/devices/test_digoo_dgsp01_dual_nightlight_switch.py

@@ -1,9 +1,7 @@
 """Tests for the switch entity."""
+from homeassistant.components.light import ColorMode, LightEntityFeature
 from homeassistant.components.switch import SwitchDeviceClass
-from homeassistant.components.light import (
-    ColorMode,
-    LightEntityFeature,
-)
+
 from ..const import DIGOO_DGSP01_SOCKET_PAYLOAD
 from ..helpers import assert_device_properties_set
 from ..mixins.switch import BasicSwitchTests

+ 2 - 2
tests/devices/test_digoo_dgsp202.py

@@ -1,11 +1,11 @@
 """Tests for Digoo DSSP202 dual switch with timers and energy monitoring"""
-from homeassistant.components.switch import SwitchDeviceClass
 from homeassistant.components.sensor import SensorDeviceClass
+from homeassistant.components.switch import SwitchDeviceClass
 from homeassistant.const import (
     UnitOfElectricCurrent,
     UnitOfElectricPotential,
-    UnitOfTime,
     UnitOfPower,
+    UnitOfTime,
 )
 
 from ..const import DIGOO_DGSP202_SOCKET_PAYLOAD

+ 1 - 5
tests/devices/test_eanons_humidifier.py

@@ -1,11 +1,7 @@
 from homeassistant.components.binary_sensor import BinarySensorDeviceClass
 from homeassistant.components.fan import FanEntityFeature
 from homeassistant.components.humidifier import HumidifierEntityFeature
-from homeassistant.components.humidifier.const import (
-    MODE_NORMAL,
-    MODE_AUTO,
-    MODE_SLEEP,
-)
+from homeassistant.components.humidifier.const import MODE_AUTO, MODE_NORMAL, MODE_SLEEP
 from homeassistant.components.sensor import SensorDeviceClass
 
 from ..const import EANONS_HUMIDIFIER_PAYLOAD

+ 2 - 2
tests/devices/test_eberg_cooly_c35hd.py

@@ -1,8 +1,8 @@
 from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
     SWING_OFF,
     SWING_VERTICAL,
+    ClimateEntityFeature,
+    HVACMode,
 )
 from homeassistant.const import UnitOfTemperature
 

+ 5 - 8
tests/devices/test_eberg_qubo_q40hd_heatpump.py

@@ -1,16 +1,13 @@
 from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACAction,
-    HVACMode,
-    PRESET_SLEEP,
     PRESET_COMFORT,
+    PRESET_SLEEP,
     SWING_OFF,
     SWING_VERTICAL,
+    ClimateEntityFeature,
+    HVACAction,
+    HVACMode,
 )
-from homeassistant.const import (
-    UnitOfTime,
-    UnitOfTemperature,
-)
+from homeassistant.const import UnitOfTemperature, UnitOfTime
 
 from ..const import EBERG_QUBO_Q40HD_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 2 - 8
tests/devices/test_ecostrad_accentiq_heater.py

@@ -1,11 +1,5 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
-from homeassistant.const import (
-    UnitOfTime,
-    UnitOfTemperature,
-)
+from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
+from homeassistant.const import UnitOfTemperature, UnitOfTime
 
 from ..const import ECOSTRAD_ACCENTIQ_HEATER_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 1 - 1
tests/devices/test_energy_monitoring_powerstrip.py

@@ -1,5 +1,5 @@
 """Tests for the energy monitoring powerstrip."""
-from homeassistant.components.sensor import SensorDeviceClass, STATE_CLASS_MEASUREMENT
+from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorDeviceClass
 from homeassistant.components.switch import SwitchDeviceClass
 from homeassistant.const import (
     UnitOfElectricCurrent,

+ 1 - 4
tests/devices/test_eurom_600_heater.py

@@ -1,8 +1,5 @@
 from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
+from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
 from homeassistant.const import UnitOfTemperature
 
 from ..const import EUROM_600_HEATER_PAYLOAD

+ 1 - 4
tests/devices/test_eurom_600v2_heater.py

@@ -1,8 +1,5 @@
 from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
+from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
 from homeassistant.const import UnitOfTemperature
 
 from ..const import EUROM_600v2_HEATER_PAYLOAD

+ 2 - 2
tests/devices/test_eurom_601_heater.py

@@ -1,9 +1,9 @@
 from homeassistant.components.binary_sensor import BinarySensorDeviceClass
 from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
     PRESET_COMFORT,
     PRESET_ECO,
+    ClimateEntityFeature,
+    HVACMode,
 )
 from homeassistant.const import UnitOfTemperature
 

+ 2 - 2
tests/devices/test_fersk_vind_2_climate.py

@@ -1,8 +1,8 @@
 from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
     SWING_OFF,
     SWING_VERTICAL,
+    ClimateEntityFeature,
+    HVACMode,
 )
 from homeassistant.const import UnitOfTemperature
 

+ 1 - 4
tests/devices/test_garage_door_opener.py

@@ -1,8 +1,5 @@
 """Tests for the simple garage door opener."""
-from homeassistant.components.cover import (
-    CoverDeviceClass,
-    CoverEntityFeature,
-)
+from homeassistant.components.cover import CoverDeviceClass, CoverEntityFeature
 
 from ..const import SIMPLE_GARAGE_DOOR_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 1 - 3
tests/devices/test_goldair_fan.py

@@ -1,6 +1,4 @@
-from homeassistant.components.fan import (
-    FanEntityFeature,
-)
+from homeassistant.components.fan import FanEntityFeature
 
 from ..const import FAN_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 2 - 5
tests/devices/test_goldair_geco_heater.py

@@ -1,9 +1,6 @@
 from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
-from homeassistant.const import UnitOfTime, UnitOfTemperature
+from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
+from homeassistant.const import UnitOfTemperature, UnitOfTime
 
 from ..const import GECO_HEATER_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 2 - 5
tests/devices/test_goldair_gpph_heater.py

@@ -1,14 +1,11 @@
 from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
+from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
 from homeassistant.components.sensor import SensorDeviceClass
 from homeassistant.const import (
     PERCENTAGE,
     PRECISION_WHOLE,
-    UnitOfTime,
     UnitOfTemperature,
+    UnitOfTime,
 )
 
 from ..const import GPPH_HEATER_PAYLOAD

+ 1 - 1
tests/devices/test_grid_connect_double_power_point.py

@@ -4,9 +4,9 @@ from homeassistant.components.switch import SwitchDeviceClass
 from homeassistant.const import (
     UnitOfElectricCurrent,
     UnitOfElectricPotential,
-    UnitOfTime,
     UnitOfEnergy,
     UnitOfPower,
+    UnitOfTime,
 )
 
 from ..const import GRIDCONNECT_2SOCKET_PAYLOAD

+ 2 - 8
tests/devices/test_himox_h05_purifier.py

@@ -1,13 +1,7 @@
 from homeassistant.components.button import ButtonDeviceClass
 from homeassistant.components.fan import FanEntityFeature
-from homeassistant.components.sensor import (
-    SensorDeviceClass,
-    STATE_CLASS_MEASUREMENT,
-)
-from homeassistant.const import (
-    PERCENTAGE,
-    UnitOfTemperature,
-)
+from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorDeviceClass
+from homeassistant.const import PERCENTAGE, UnitOfTemperature
 
 from ..const import HIMOX_H05_PURIFIER_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 1 - 4
tests/devices/test_himox_h06_purifier.py

@@ -1,10 +1,7 @@
 from homeassistant.components.button import ButtonDeviceClass
 from homeassistant.components.fan import FanEntityFeature
 from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import (
-    PERCENTAGE,
-    UnitOfTime,
-)
+from homeassistant.const import PERCENTAGE, UnitOfTime
 
 from ..const import HIMOX_H06_PURIFIER_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 1 - 1
tests/devices/test_hydrotherm_dynamicx8.py

@@ -2,8 +2,8 @@ from homeassistant.components.binary_sensor import BinarySensorDeviceClass
 from homeassistant.components.water_heater import (
     STATE_ECO,
     STATE_ELECTRIC,
-    STATE_HIGH_DEMAND,
     STATE_HEAT_PUMP,
+    STATE_HIGH_DEMAND,
     STATE_OFF,
     STATE_PERFORMANCE,
     WaterHeaterEntityFeature,

+ 1 - 1
tests/devices/test_immax_neo_light_vento.py

@@ -1,7 +1,7 @@
 from homeassistant.components.fan import (
-    FanEntityFeature,
     DIRECTION_FORWARD,
     DIRECTION_REVERSE,
+    FanEntityFeature,
 )
 
 from ..helpers import assert_device_properties_set

+ 2 - 6
tests/devices/test_inkbird_itc308_thermostat.py

@@ -1,11 +1,7 @@
 from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACAction,
-)
+from homeassistant.components.climate.const import ClimateEntityFeature, HVACAction
 from homeassistant.components.number.const import NumberDeviceClass
-from homeassistant.const import UnitOfTime, UnitOfTemperature
-
+from homeassistant.const import UnitOfTemperature, UnitOfTime
 
 from ..const import INKBIRD_ITC308_THERMOSTAT_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 1 - 1
tests/devices/test_inkbird_sousvide.py

@@ -5,7 +5,7 @@ from homeassistant.components.climate.const import (
     HVACMode,
 )
 from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import UnitOfTime, UnitOfTemperature
+from homeassistant.const import UnitOfTemperature, UnitOfTime
 
 from ..const import INKBIRD_SOUSVIDE_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 4 - 12
tests/devices/test_jiahong_et72w_thermostat.py

@@ -1,16 +1,8 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
+from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
 from homeassistant.components.number.const import NumberDeviceClass
-from homeassistant.components.sensor import (
-    SensorDeviceClass,
-    STATE_CLASS_MEASUREMENT,
-)
-from homeassistant.const import (
-    UnitOfEnergy,
-    UnitOfTemperature,
-)
+from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorDeviceClass
+from homeassistant.const import UnitOfEnergy, UnitOfTemperature
+
 from ..const import JIAHONG_ET72W_PAYLOAD
 from ..helpers import assert_device_properties_set
 from ..mixins.climate import TargetTemperatureTests

+ 1 - 4
tests/devices/test_kogan_garage_door_opener.py

@@ -1,9 +1,6 @@
 """Tests for the simple garage door opener."""
 from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.cover import (
-    CoverDeviceClass,
-    CoverEntityFeature,
-)
+from homeassistant.components.cover import CoverDeviceClass, CoverEntityFeature
 from homeassistant.components.sensor import SensorDeviceClass
 
 from ..const import KOGAN_GARAGE_DOOR_PAYLOAD

+ 1 - 3
tests/devices/test_kogan_glass_1_7l_kettle.py

@@ -1,6 +1,4 @@
-from homeassistant.components.climate.const import (
-    HVACMode,
-)
+from homeassistant.components.climate.const import HVACMode
 
 from ..const import KOGAN_GLASS_1_7L_KETTLE_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 1 - 4
tests/devices/test_kogan_kawfpac09ya_airconditioner.py

@@ -1,7 +1,4 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
+from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
 from homeassistant.const import UnitOfTemperature
 
 from ..const import KOGAN_KAWFPAC09YA_AIRCON_PAYLOAD

+ 1 - 5
tests/devices/test_kyvol_e30_vacuum.py

@@ -9,11 +9,7 @@ from homeassistant.components.vacuum import (
     STATE_RETURNING,
     VacuumEntityFeature,
 )
-from homeassistant.const import (
-    AREA_SQUARE_METERS,
-    UnitOfTime,
-    PERCENTAGE,
-)
+from homeassistant.const import AREA_SQUARE_METERS, PERCENTAGE, UnitOfTime
 
 from ..const import KYVOL_E30_VACUUM_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 1 - 4
tests/devices/test_lefant_m213_vacuum.py

@@ -8,10 +8,7 @@ from homeassistant.components.vacuum import (
     STATE_RETURNING,
     VacuumEntityFeature,
 )
-from homeassistant.const import (
-    AREA_SQUARE_METERS,
-    UnitOfTime,
-)
+from homeassistant.const import AREA_SQUARE_METERS, UnitOfTime
 
 from ..const import LEFANT_M213_VACUUM_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 2 - 5
tests/devices/test_m027_curtain.py

@@ -1,14 +1,11 @@
 """Tests for the M027 curtain module."""
-from homeassistant.components.cover import (
-    CoverDeviceClass,
-    CoverEntityFeature,
-)
+from homeassistant.components.cover import CoverDeviceClass, CoverEntityFeature
 from homeassistant.const import UnitOfTime
 
 from ..const import M027_CURTAIN_PAYLOAD
 from ..helpers import assert_device_properties_set
-from ..mixins.sensor import MultiSensorTests
 from ..mixins.select import BasicSelectTests
+from ..mixins.sensor import MultiSensorTests
 from .base_device_tests import TuyaDeviceTestCase
 
 COMMAND_DPS = "1"

+ 2 - 2
tests/devices/test_moes_bht002_thermostat.py

@@ -1,8 +1,8 @@
 from homeassistant.components.climate.const import (
+    PRESET_COMFORT,
+    PRESET_ECO,
     ClimateEntityFeature,
     HVACMode,
-    PRESET_ECO,
-    PRESET_COMFORT,
 )
 from homeassistant.const import UnitOfTemperature
 

+ 2 - 5
tests/devices/test_moes_rgb_socket.py

@@ -1,15 +1,12 @@
 """Tests for the MoesHouse RGB smart socket."""
-from homeassistant.components.light import (
-    ColorMode,
-    LightEntityFeature,
-)
+from homeassistant.components.light import ColorMode, LightEntityFeature
 from homeassistant.components.sensor import SensorDeviceClass
 from homeassistant.components.switch import SwitchDeviceClass
 from homeassistant.const import (
     UnitOfElectricCurrent,
     UnitOfElectricPotential,
-    UnitOfTime,
     UnitOfPower,
+    UnitOfTime,
 )
 
 from ..const import MOES_RGB_SOCKET_PAYLOAD

+ 1 - 1
tests/devices/test_moes_temp_humidity.py

@@ -1,5 +1,5 @@
 from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import UnitOfTime, UnitOfTemperature
+from homeassistant.const import UnitOfTemperature, UnitOfTime
 
 from ..const import MOES_TEMP_HUMID_PAYLOAD
 from ..mixins.number import MultiNumberTests

+ 2 - 7
tests/devices/test_nashone_mts700wb_thermostat.py

@@ -1,12 +1,7 @@
 from homeassistant.components.button import ButtonDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
+from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
 from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import (
-    UnitOfTime,
-)
+from homeassistant.const import UnitOfTime
 
 from ..const import NASHONE_MTS700WB_THERMOSTAT_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 3 - 3
tests/devices/test_nedis_htpl20f_heater.py

@@ -1,11 +1,11 @@
 from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
     PRESET_AWAY,
     PRESET_COMFORT,
     PRESET_ECO,
+    ClimateEntityFeature,
+    HVACMode,
 )
-from homeassistant.const import UnitOfTime, UnitOfTemperature
+from homeassistant.const import UnitOfTemperature, UnitOfTime
 
 from ..const import NEDIS_HTPL20F_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 5 - 7
tests/devices/test_parkside_plgs2012a1_smart_charger.py

@@ -1,16 +1,14 @@
 """Tests for Parkside PLGS 2012 A1 Smart Charger"""
+from homeassistant.components.number.const import NumberDeviceClass
+from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorDeviceClass
 from homeassistant.const import (
+    PERCENTAGE,
     UnitOfElectricCurrent,
     UnitOfElectricPotential,
-    PERCENTAGE,
-    UnitOfTime,
     UnitOfTemperature,
+    UnitOfTime,
 )
-from homeassistant.components.number.const import NumberDeviceClass
-from homeassistant.components.sensor import (
-    SensorDeviceClass,
-    STATE_CLASS_MEASUREMENT,
-)
+
 from ..const import PARKSIDE_PLGS2012A1_PAYLOAD
 from ..mixins.binary_sensor import MultiBinarySensorTests
 from ..mixins.number import MultiNumberTests

+ 2 - 2
tests/devices/test_pc321ty_energy_meter.py

@@ -1,14 +1,14 @@
 """Tests for the PC321-TY Power Clamp Energy meter"""
 from homeassistant.components.sensor import (
-    SensorDeviceClass,
     STATE_CLASS_MEASUREMENT,
     STATE_CLASS_TOTAL_INCREASING,
+    SensorDeviceClass,
 )
 from homeassistant.const import (
     UnitOfElectricCurrent,
     UnitOfElectricPotential,
-    UnitOfFrequency,
     UnitOfEnergy,
+    UnitOfFrequency,
     UnitOfPower,
     UnitOfTemperature,
 )

+ 1 - 4
tests/devices/test_poiema_one_purifier.py

@@ -1,10 +1,7 @@
 from homeassistant.components.button import ButtonDeviceClass
 from homeassistant.components.fan import FanEntityFeature
 from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import (
-    CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
-    UnitOfTime,
-)
+from homeassistant.const import CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, UnitOfTime
 
 from ..const import POIEMA_ONE_PURIFIER_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 1 - 4
tests/devices/test_poolex_qline_heatpump.py

@@ -1,8 +1,5 @@
 from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
+from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
 from homeassistant.const import UnitOfTemperature
 
 from ..const import POOLEX_QLINE_HEATPUMP_PAYLOAD

+ 1 - 4
tests/devices/test_qs_c01_curtain.py

@@ -1,8 +1,5 @@
 """Tests for the QS C01 curtain module."""
-from homeassistant.components.cover import (
-    CoverDeviceClass,
-    CoverEntityFeature,
-)
+from homeassistant.components.cover import CoverDeviceClass, CoverEntityFeature
 from homeassistant.const import UnitOfTime
 
 from ..const import QS_C01_CURTAIN_PAYLOAD

+ 1 - 4
tests/devices/test_rgbcw_lightbulb.py

@@ -1,7 +1,4 @@
-from homeassistant.components.light import (
-    ColorMode,
-    LightEntityFeature,
-)
+from homeassistant.components.light import ColorMode, LightEntityFeature
 from homeassistant.const import UnitOfTime
 
 from ..const import RGBCW_LIGHTBULB_PAYLOAD

+ 1 - 4
tests/devices/test_simple_blinds.py

@@ -1,8 +1,5 @@
 """Tests for the simple blinds controller."""
-from homeassistant.components.cover import (
-    CoverDeviceClass,
-    CoverEntityFeature,
-)
+from homeassistant.components.cover import CoverDeviceClass, CoverEntityFeature
 
 from ..const import SIMPLE_BLINDS_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 1 - 3
tests/devices/test_smartplug_encoded.py

@@ -1,8 +1,6 @@
 """Tests for the switch entity."""
 from homeassistant.components.switch import SwitchDeviceClass
-from homeassistant.const import (
-    UnitOfTime,
-)
+from homeassistant.const import UnitOfTime
 
 from ..const import SMARTPLUG_ENCODED_PAYLOAD
 from ..mixins.number import BasicNumberTests

+ 2 - 2
tests/devices/test_smartplugv1.py

@@ -1,12 +1,12 @@
 """Tests for the switch entity."""
 from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.switch import SwitchDeviceClass
 from homeassistant.components.sensor import SensorDeviceClass
+from homeassistant.components.switch import SwitchDeviceClass
 from homeassistant.const import (
     UnitOfElectricCurrent,
     UnitOfElectricPotential,
-    UnitOfTime,
     UnitOfPower,
+    UnitOfTime,
 )
 
 from ..const import KOGAN_SOCKET_PAYLOAD

+ 1 - 1
tests/devices/test_smartplugv2.py

@@ -4,8 +4,8 @@ from homeassistant.components.switch import SwitchDeviceClass
 from homeassistant.const import (
     UnitOfElectricCurrent,
     UnitOfElectricPotential,
-    UnitOfTime,
     UnitOfPower,
+    UnitOfTime,
 )
 
 from ..const import KOGAN_SOCKET_PAYLOAD2

+ 1 - 1
tests/devices/test_smartplugv2_energy.py

@@ -5,9 +5,9 @@ from homeassistant.components.switch import SwitchDeviceClass
 from homeassistant.const import (
     UnitOfElectricCurrent,
     UnitOfElectricPotential,
-    UnitOfTime,
     UnitOfEnergy,
     UnitOfPower,
+    UnitOfTime,
 )
 
 from ..const import SMARTSWITCH_ENERGY_PAYLOAD

+ 1 - 3
tests/devices/test_starlight_heatpump.py

@@ -1,6 +1,4 @@
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-)
+from homeassistant.components.climate.const import ClimateEntityFeature
 
 from ..const import STARLIGHT_HEATPUMP_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 2 - 3
tests/devices/test_tmwf02_fan.py

@@ -1,7 +1,6 @@
 from homeassistant.components.fan import FanEntityFeature
-from homeassistant.const import (
-    UnitOfTime,
-)
+from homeassistant.const import UnitOfTime
+
 from ..const import TMWF02_FAN_PAYLOAD
 from ..helpers import assert_device_properties_set
 from ..mixins.number import BasicNumberTests

+ 1 - 1
tests/devices/test_tompd63lw_breaker.py

@@ -3,8 +3,8 @@ from homeassistant.components.sensor import SensorDeviceClass
 from homeassistant.const import (
     UnitOfElectricCurrent,
     UnitOfElectricPotential,
-    UnitOfTime,
     UnitOfPower,
+    UnitOfTime,
 )
 
 from ..const import TOMPD63LW_SOCKET_PAYLOAD

+ 1 - 4
tests/devices/test_vork_vk6067aw_purifier.py

@@ -2,10 +2,7 @@ from homeassistant.components.binary_sensor import BinarySensorDeviceClass
 from homeassistant.components.button import ButtonDeviceClass
 from homeassistant.components.fan import FanEntityFeature
 from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import (
-    PERCENTAGE,
-    UnitOfTime,
-)
+from homeassistant.const import PERCENTAGE, UnitOfTime
 
 from ..const import VORK_VK6067_PURIFIER_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 1 - 4
tests/devices/test_weau_pool_heatpumpv2.py

@@ -1,8 +1,5 @@
 from homeassistant.components.binary_sensor import BinarySensorDeviceClass
-from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
-)
+from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
 
 from ..const import WEAU_POOL_HEATPUMPV2_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 1 - 3
tests/devices/test_wetair_wawh1210lw_humidifier.py

@@ -6,9 +6,7 @@ from homeassistant.components.humidifier.const import (
     MODE_SLEEP,
 )
 from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import (
-    PERCENTAGE,
-)
+from homeassistant.const import PERCENTAGE
 
 from ..const import WETAIR_WAWH1210_HUMIDIFIER_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 4 - 4
tests/devices/test_wetair_wch750_heater.py

@@ -1,12 +1,12 @@
 from homeassistant.components.climate.const import (
-    ClimateEntityFeature,
-    HVACMode,
     PRESET_AWAY,
-    PRESET_COMFORT,
     PRESET_BOOST,
+    PRESET_COMFORT,
+    ClimateEntityFeature,
+    HVACMode,
 )
 from homeassistant.components.sensor import SensorDeviceClass
-from homeassistant.const import UnitOfTime, UnitOfTemperature
+from homeassistant.const import UnitOfTemperature, UnitOfTime
 
 from ..const import WETAIR_WCH750_HEATER_PAYLOAD
 from ..helpers import assert_device_properties_set

+ 1 - 5
tests/devices/test_wilfa_haze_hu400bc_humidifier.py

@@ -1,11 +1,7 @@
 from homeassistant.components.binary_sensor import BinarySensorDeviceClass
 from homeassistant.components.humidifier import HumidifierEntityFeature
-from homeassistant.components.humidifier.const import (
-    MODE_AUTO,
-    MODE_NORMAL,
-)
+from homeassistant.components.humidifier.const import MODE_AUTO, MODE_NORMAL
 from homeassistant.components.sensor import SensorDeviceClass
-
 from homeassistant.const import PERCENTAGE, UnitOfTemperature
 
 from ..const import WILFA_HAZE_HUMIDIFIER_PAYLOAD

+ 1 - 0
tests/mixins/climate.py

@@ -1,5 +1,6 @@
 # Mixins for testing climate entities
 from math import floor
+
 from ..helpers import assert_device_properties_set
 
 

+ 1 - 3
tests/mixins/light.py

@@ -1,7 +1,5 @@
 # Mixins for testing lights
-from homeassistant.components.light import (
-    ColorMode,
-)
+from homeassistant.components.light import ColorMode
 
 from ..helpers import assert_device_properties_set
 

+ 7 - 6
tests/test_alarm_control_panel.py

@@ -1,18 +1,19 @@
 """Tests for the alarm_control_panel entity."""
-from pytest_homeassistant_custom_component.common import MockConfigEntry
-import pytest
 from unittest.mock import AsyncMock, Mock
 
+import pytest
+from pytest_homeassistant_custom_component.common import MockConfigEntry
+
+from custom_components.tuya_local.alarm_control_panel import (
+    TuyaLocalAlarmControlPanel,
+    async_setup_entry,
+)
 from custom_components.tuya_local.const import (
     CONF_DEVICE_ID,
     CONF_PROTOCOL_VERSION,
     CONF_TYPE,
     DOMAIN,
 )
-from custom_components.tuya_local.alarm_control_panel import (
-    async_setup_entry,
-    TuyaLocalAlarmControlPanel,
-)
 
 
 @pytest.mark.asyncio

+ 7 - 6
tests/test_binary_sensor.py

@@ -1,18 +1,19 @@
 """Tests for the binary_sensor entity."""
-from pytest_homeassistant_custom_component.common import MockConfigEntry
-import pytest
 from unittest.mock import AsyncMock, Mock
 
+import pytest
+from pytest_homeassistant_custom_component.common import MockConfigEntry
+
+from custom_components.tuya_local.binary_sensor import (
+    TuyaLocalBinarySensor,
+    async_setup_entry,
+)
 from custom_components.tuya_local.const import (
     CONF_DEVICE_ID,
     CONF_PROTOCOL_VERSION,
     CONF_TYPE,
     DOMAIN,
 )
-from custom_components.tuya_local.binary_sensor import (
-    async_setup_entry,
-    TuyaLocalBinarySensor,
-)
 
 
 @pytest.mark.asyncio

+ 4 - 6
tests/test_button.py

@@ -1,18 +1,16 @@
 """Tests for the button entity."""
-from pytest_homeassistant_custom_component.common import MockConfigEntry
-import pytest
 from unittest.mock import AsyncMock, Mock
 
+import pytest
+from pytest_homeassistant_custom_component.common import MockConfigEntry
+
+from custom_components.tuya_local.button import TuyaLocalButton, async_setup_entry
 from custom_components.tuya_local.const import (
     CONF_DEVICE_ID,
     CONF_PROTOCOL_VERSION,
     CONF_TYPE,
     DOMAIN,
 )
-from custom_components.tuya_local.button import (
-    async_setup_entry,
-    TuyaLocalButton,
-)
 
 
 @pytest.mark.asyncio

+ 4 - 6
tests/test_camera.py

@@ -1,18 +1,16 @@
 """Tests for the camera entity."""
-from pytest_homeassistant_custom_component.common import MockConfigEntry
-import pytest
 from unittest.mock import AsyncMock, Mock
 
+import pytest
+from pytest_homeassistant_custom_component.common import MockConfigEntry
+
+from custom_components.tuya_local.camera import TuyaLocalCamera, async_setup_entry
 from custom_components.tuya_local.const import (
     CONF_DEVICE_ID,
     CONF_PROTOCOL_VERSION,
     CONF_TYPE,
     DOMAIN,
 )
-from custom_components.tuya_local.camera import (
-    async_setup_entry,
-    TuyaLocalCamera,
-)
 
 
 @pytest.mark.asyncio

+ 4 - 3
tests/test_climate.py

@@ -1,15 +1,16 @@
 """Tests for the light entity."""
-from pytest_homeassistant_custom_component.common import MockConfigEntry
-import pytest
 from unittest.mock import AsyncMock, Mock
 
+import pytest
+from pytest_homeassistant_custom_component.common import MockConfigEntry
+
+from custom_components.tuya_local.climate import TuyaLocalClimate, async_setup_entry
 from custom_components.tuya_local.const import (
     CONF_DEVICE_ID,
     CONF_PROTOCOL_VERSION,
     CONF_TYPE,
     DOMAIN,
 )
-from custom_components.tuya_local.climate import async_setup_entry, TuyaLocalClimate
 
 
 @pytest.mark.asyncio

+ 4 - 5
tests/test_config_flow.py

@@ -1,20 +1,19 @@
 """Tests for the config flow."""
 from unittest.mock import ANY, AsyncMock, MagicMock, patch
 
-from homeassistant.const import CONF_HOST, CONF_NAME
 import pytest
-from pytest_homeassistant_custom_component.common import MockConfigEntry
-
 import voluptuous as vol
+from homeassistant.const import CONF_HOST, CONF_NAME
+from pytest_homeassistant_custom_component.common import MockConfigEntry
 
 from custom_components.tuya_local import (
-    config_flow,
     async_migrate_entry,
     async_setup_entry,
+    config_flow,
 )
 from custom_components.tuya_local.const import (
-    CONF_DEVICE_ID,
     CONF_DEVICE_CID,
+    CONF_DEVICE_ID,
     CONF_LOCAL_KEY,
     CONF_POLL_ONLY,
     CONF_PROTOCOL_VERSION,

+ 5 - 4
tests/test_cover.py

@@ -1,15 +1,16 @@
 """Tests for the cover entity."""
-from pytest_homeassistant_custom_component.common import MockConfigEntry
-import pytest
 from unittest.mock import AsyncMock, Mock
 
+import pytest
+from pytest_homeassistant_custom_component.common import MockConfigEntry
+
 from custom_components.tuya_local.const import (
     CONF_DEVICE_ID,
-    CONF_TYPE,
     CONF_PROTOCOL_VERSION,
+    CONF_TYPE,
     DOMAIN,
 )
-from custom_components.tuya_local.cover import async_setup_entry, TuyaLocalCover
+from custom_components.tuya_local.cover import TuyaLocalCover, async_setup_entry
 
 
 @pytest.mark.asyncio

+ 3 - 8
tests/test_device.py

@@ -1,20 +1,15 @@
 from datetime import datetime
 from time import time
 from unittest import IsolatedAsyncioTestCase
-from unittest.mock import AsyncMock, Mock, call, patch, ANY
+from unittest.mock import ANY, AsyncMock, Mock, call, patch
 
-from homeassistant.const import (
-    EVENT_HOMEASSISTANT_STARTED,
-    EVENT_HOMEASSISTANT_STOP,
-)
+from homeassistant.const import EVENT_HOMEASSISTANT_STARTED, EVENT_HOMEASSISTANT_STOP
 
 from custom_components.tuya_local.device import TuyaLocalDevice
 from custom_components.tuya_local.helpers.device_config import TuyaEntityConfig
 from custom_components.tuya_local.switch import TuyaLocalSwitch
 
-from .const import (
-    EUROM_600_HEATER_PAYLOAD,
-)
+from .const import EUROM_600_HEATER_PAYLOAD
 
 
 class TestDevice(IsolatedAsyncioTestCase):

+ 6 - 9
tests/test_device_config.py

@@ -1,26 +1,23 @@
 """Test the config parser"""
-from fuzzywuzzy import fuzz
 from unittest import IsolatedAsyncioTestCase
 from unittest.mock import MagicMock
 
+from fuzzywuzzy import fuzz
 from homeassistant.components.sensor import SensorDeviceClass
 
 from custom_components.tuya_local.helpers.config import get_device_id
 from custom_components.tuya_local.helpers.device_config import (
-    available_configs,
-    get_config,
-    _bytes_to_fmt,
-    _typematch,
     TuyaDeviceConfig,
     TuyaDpsConfig,
     TuyaEntityConfig,
+    _bytes_to_fmt,
+    _typematch,
+    available_configs,
+    get_config,
 )
 from custom_components.tuya_local.sensor import TuyaLocalSensor
 
-from .const import (
-    GPPH_HEATER_PAYLOAD,
-    KOGAN_HEATER_PAYLOAD,
-)
+from .const import GPPH_HEATER_PAYLOAD, KOGAN_HEATER_PAYLOAD
 
 KNOWN_DPS = {
     "alarm_control_panel": {

+ 4 - 4
tests/test_diagnostics.py

@@ -1,16 +1,16 @@
 """Tests for diagnostics platform"""
-from pytest_homeassistant_custom_component.common import MockConfigEntry
-import pytest
 from unittest.mock import AsyncMock
 
+import pytest
+from pytest_homeassistant_custom_component.common import MockConfigEntry
+
 from custom_components.tuya_local.const import (
-    DOMAIN,
     CONF_DEVICE_ID,
     CONF_LOCAL_KEY,
     CONF_PROTOCOL_VERSION,
     CONF_TYPE,
+    DOMAIN,
 )
-
 from custom_components.tuya_local.diagnostics import (
     async_get_config_entry_diagnostics,
     async_get_device_diagnostics,

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff