Explorar o código

Reformat according to latest version of black.

It seems the latest version of black wants all multiline statements to split
on all comma's.  The previous version put the contents in parentheses on a single
line if they fitted.  Rather than fighting against different versions of black,
upgrade the editor's version to match the server build.
Jason Rumney %!s(int64=4) %!d(string=hai) anos
pai
achega
a9eff5571e

+ 4 - 2
tests/dehumidifier/test_climate.py

@@ -192,7 +192,8 @@ class TestGoldairDehumidifier(IsolatedAsyncioTestCase):
         ]
 
         async with assert_device_properties_set(
-            self.subject._device, {PROPERTY_TO_DPS_ID[ATTR_TARGET_HUMIDITY]: 55},
+            self.subject._device,
+            {PROPERTY_TO_DPS_ID[ATTR_TARGET_HUMIDITY]: 55},
         ):
             await self.subject.async_set_humidity(53)
 
@@ -202,7 +203,8 @@ class TestGoldairDehumidifier(IsolatedAsyncioTestCase):
         ]
 
         async with assert_device_properties_set(
-            self.subject._device, {PROPERTY_TO_DPS_ID[ATTR_TARGET_HUMIDITY]: 50},
+            self.subject._device,
+            {PROPERTY_TO_DPS_ID[ATTR_TARGET_HUMIDITY]: 50},
         ):
             await self.subject.async_set_humidity(52)
 

+ 5 - 5
tests/eurom_600_heater/test_climate.py

@@ -3,7 +3,6 @@ from unittest.mock import AsyncMock, patch
 
 from homeassistant.components.climate.const import (
     ATTR_HVAC_MODE,
-    ATTR_PRESET_MODE,
     HVAC_MODE_HEAT,
     HVAC_MODE_OFF,
     SUPPORT_TARGET_TEMPERATURE,
@@ -16,7 +15,6 @@ from custom_components.tuya_local.eurom_600_heater.climate import (
 from custom_components.tuya_local.eurom_600_heater.const import (
     ATTR_ERROR,
     ATTR_TARGET_TEMPERATURE,
-    HVAC_MODE_TO_DPS_MODE,
     PROPERTY_TO_DPS_ID,
 )
 
@@ -37,7 +35,8 @@ class TestEuromMonSoleil600Heater(IsolatedAsyncioTestCase):
 
     def test_supported_features(self):
         self.assertEqual(
-            self.subject.supported_features, SUPPORT_TARGET_TEMPERATURE,
+            self.subject.supported_features,
+            SUPPORT_TARGET_TEMPERATURE,
         )
 
     def test_should_poll(self):
@@ -95,7 +94,8 @@ class TestEuromMonSoleil600Heater(IsolatedAsyncioTestCase):
 
     async def test_set_target_temperature_rounds_value_to_closest_integer(self):
         async with assert_device_properties_set(
-            self.subject._device, {PROPERTY_TO_DPS_ID[ATTR_TARGET_TEMPERATURE]: 25},
+            self.subject._device,
+            {PROPERTY_TO_DPS_ID[ATTR_TARGET_TEMPERATURE]: 25},
         ):
             await self.subject.async_set_target_temperature(24.6)
 
@@ -140,7 +140,7 @@ class TestEuromMonSoleil600Heater(IsolatedAsyncioTestCase):
             await self.subject.async_set_hvac_mode(HVAC_MODE_OFF)
 
     def test_error_state(self):
-        # There are currently no known error states; update this as they're discovered
+        # There are currently no known error states; update if discovered
         self.dps[PROPERTY_TO_DPS_ID[ATTR_ERROR]] = "something"
         self.assertEqual(
             self.subject.device_state_attributes, {ATTR_ERROR: "something"}

+ 6 - 3
tests/fan/test_climate.py

@@ -224,7 +224,8 @@ class TestGoldairFan(IsolatedAsyncioTestCase):
         ]
 
         async with assert_device_properties_set(
-            self.subject._device, {PROPERTY_TO_DPS_ID[ATTR_FAN_MODE]: "6"},
+            self.subject._device,
+            {PROPERTY_TO_DPS_ID[ATTR_FAN_MODE]: "6"},
         ):
             await self.subject.async_set_fan_mode(6)
 
@@ -251,7 +252,8 @@ class TestGoldairFan(IsolatedAsyncioTestCase):
         ]
 
         async with assert_device_properties_set(
-            self.subject._device, {PROPERTY_TO_DPS_ID[ATTR_FAN_MODE]: "4"},
+            self.subject._device,
+            {PROPERTY_TO_DPS_ID[ATTR_FAN_MODE]: "4"},
         ):
             await self.subject.async_set_fan_mode(1)
 
@@ -278,7 +280,8 @@ class TestGoldairFan(IsolatedAsyncioTestCase):
         ]
 
         async with assert_device_properties_set(
-            self.subject._device, {PROPERTY_TO_DPS_ID[ATTR_FAN_MODE]: "8"},
+            self.subject._device,
+            {PROPERTY_TO_DPS_ID[ATTR_FAN_MODE]: "8"},
         ):
             await self.subject.async_set_fan_mode(2)
 

+ 2 - 1
tests/gardenpac_heatpump/test_climate.py

@@ -108,7 +108,8 @@ class TestGardenPACPoolHeatpump(IsolatedAsyncioTestCase):
 
     async def test_set_target_temperature_rounds_value_to_closest_integer(self):
         async with assert_device_properties_set(
-            self.subject._device, {PROPERTY_TO_DPS_ID[ATTR_TARGET_TEMPERATURE]: 25},
+            self.subject._device,
+            {PROPERTY_TO_DPS_ID[ATTR_TARGET_TEMPERATURE]: 25},
         ):
             await self.subject.async_set_target_temperature(24.6)
 

+ 4 - 2
tests/geco_heater/test_climate.py

@@ -35,7 +35,8 @@ class TestGoldairGECOHeater(IsolatedAsyncioTestCase):
 
     def test_supported_features(self):
         self.assertEqual(
-            self.subject.supported_features, SUPPORT_TARGET_TEMPERATURE,
+            self.subject.supported_features,
+            SUPPORT_TARGET_TEMPERATURE,
         )
 
     def test_should_poll(self):
@@ -93,7 +94,8 @@ class TestGoldairGECOHeater(IsolatedAsyncioTestCase):
 
     async def test_set_target_temperature_rounds_value_to_closest_integer(self):
         async with assert_device_properties_set(
-            self.subject._device, {PROPERTY_TO_DPS_ID[ATTR_TARGET_TEMPERATURE]: 25},
+            self.subject._device,
+            {PROPERTY_TO_DPS_ID[ATTR_TARGET_TEMPERATURE]: 25},
         ):
             await self.subject.async_set_target_temperature(24.6)
 

+ 2 - 1
tests/gpcv_heater/test_climate.py

@@ -119,7 +119,8 @@ class TestGoldairGPCVHeater(IsolatedAsyncioTestCase):
 
     async def test_set_target_temperature_rounds_value_to_closest_integer(self):
         async with assert_device_properties_set(
-            self.subject._device, {PROPERTY_TO_DPS_ID[ATTR_TARGET_TEMPERATURE]: 25},
+            self.subject._device,
+            {PROPERTY_TO_DPS_ID[ATTR_TARGET_TEMPERATURE]: 25},
         ):
             await self.subject.async_set_target_temperature(24.6)
 

+ 2 - 1
tests/gsh_heater/test_climate.py

@@ -120,7 +120,8 @@ class TestAnderssonGSHHeater(IsolatedAsyncioTestCase):
 
     async def test_set_target_temperature_rounds_value_to_closest_integer(self):
         async with assert_device_properties_set(
-            self.subject._device, {PROPERTY_TO_DPS_ID[ATTR_TARGET_TEMPERATURE]: 25},
+            self.subject._device,
+            {PROPERTY_TO_DPS_ID[ATTR_TARGET_TEMPERATURE]: 25},
         ):
             await self.subject.async_set_target_temperature(24.6)
 

+ 4 - 2
tests/heater/test_climate.py

@@ -193,7 +193,8 @@ class TestGoldairHeater(IsolatedAsyncioTestCase):
 
     async def test_set_target_temperature_rounds_value_to_closest_integer(self):
         async with assert_device_properties_set(
-            self.subject._device, {PROPERTY_TO_DPS_ID[ATTR_TARGET_TEMPERATURE]: 25},
+            self.subject._device,
+            {PROPERTY_TO_DPS_ID[ATTR_TARGET_TEMPERATURE]: 25},
         ):
             await self.subject.async_set_target_temperature(24.6)
 
@@ -353,7 +354,8 @@ class TestGoldairHeater(IsolatedAsyncioTestCase):
 
     def test_power_levels(self):
         self.assertEqual(
-            self.subject.swing_modes, ["Stop", "1", "2", "3", "4", "5", "Auto"],
+            self.subject.swing_modes,
+            ["Stop", "1", "2", "3", "4", "5", "Auto"],
         )
 
     async def test_set_power_level_to_stop(self):

+ 3 - 1
tests/helpers.py

@@ -27,7 +27,9 @@ async def assert_device_properties_set(device: TuyaLocalDevice, properties: dict
 
 @asynccontextmanager
 async def assert_device_properties_set_optional(
-    device: TuyaLocalDevice, properties: dict, optional_properties: dict,
+    device: TuyaLocalDevice,
+    properties: dict,
+    optional_properties: dict,
 ):
     results = []
 

+ 4 - 2
tests/kogan_heater/test_climate.py

@@ -119,7 +119,8 @@ class TestKoganHeater(IsolatedAsyncioTestCase):
 
     async def test_set_target_temperature_rounds_value_to_closest_integer(self):
         async with assert_device_properties_set(
-            self.subject._device, {PROPERTY_TO_DPS_ID[ATTR_TARGET_TEMPERATURE]: 25},
+            self.subject._device,
+            {PROPERTY_TO_DPS_ID[ATTR_TARGET_TEMPERATURE]: 25},
         ):
             await self.subject.async_set_target_temperature(24.6)
 
@@ -201,7 +202,8 @@ class TestKoganHeater(IsolatedAsyncioTestCase):
     def test_device_state_attributes(self):
         self.dps[PROPERTY_TO_DPS_ID[ATTR_TIMER]] = 1
         self.assertEqual(
-            self.subject.device_state_attributes, {ATTR_TIMER: 1},
+            self.subject.device_state_attributes,
+            {ATTR_TIMER: 1},
         )
 
     async def test_update(self):

+ 6 - 3
tests/purline_m100_heater/test_climate.py

@@ -111,7 +111,8 @@ class TestPulineM100Heater(IsolatedAsyncioTestCase):
 
     async def test_set_target_temperature_rounds_value_to_closest_integer(self):
         async with assert_device_properties_set(
-            self.subject._device, {PROPERTY_TO_DPS_ID[ATTR_TARGET_TEMPERATURE]: 25},
+            self.subject._device,
+            {PROPERTY_TO_DPS_ID[ATTR_TARGET_TEMPERATURE]: 25},
         ):
             await self.subject.async_set_target_temperature(24.6)
 
@@ -159,7 +160,8 @@ class TestPulineM100Heater(IsolatedAsyncioTestCase):
 
     async def test_turn_off(self):
         async with assert_device_properties_set(
-            self.subject._device, {PROPERTY_TO_DPS_ID[ATTR_HVAC_MODE]: False},
+            self.subject._device,
+            {PROPERTY_TO_DPS_ID[ATTR_HVAC_MODE]: False},
         ):
             await self.subject.async_set_hvac_mode(HVAC_MODE_OFF)
 
@@ -206,7 +208,8 @@ class TestPulineM100Heater(IsolatedAsyncioTestCase):
 
     def test_swing_modes(self):
         self.assertCountEqual(
-            self.subject.swing_modes, [SWING_OFF, SWING_VERTICAL],
+            self.subject.swing_modes,
+            [SWING_OFF, SWING_VERTICAL],
         )
 
     async def test_set_swing_mode_on(self):

+ 4 - 4
tests/test_device_config.py

@@ -37,10 +37,10 @@ def test_config_files_parse():
 
 def test_config_files_have_legacy_link():
     """
-       Initially, we require a link between the new style config, and the old
-       classes so we can transition over to the new config.  When the
-       transition is complete, we will drop the requirement, as new devices
-       will only be added as config files.
+    Initially, we require a link between the new style config, and the old
+    classes so we can transition over to the new config.  When the
+    transition is complete, we will drop the requirement, as new devices
+    will only be added as config files.
     """
     for cfg in available_configs():
         parsed = TuyaDeviceConfig(cfg)