|
| 1 | +# pylint: disable=protected-access |
1 | 2 | """Test Plugwise Home Assistant module and generate test JSON fixtures.""" |
2 | 3 | import asyncio |
3 | 4 | import importlib |
@@ -286,8 +287,8 @@ async def connect( |
286 | 287 | ) |
287 | 288 |
|
288 | 289 | if not timeout: |
289 | | - assert smile._timeout == 30 # pylint: disable=protected-access |
290 | | - assert smile._domain_objects is None # pylint: disable=protected-access |
| 290 | + assert smile._timeout == 30 |
| 291 | + assert smile._domain_objects is None |
291 | 292 | assert smile.smile_type is None |
292 | 293 |
|
293 | 294 | # Connect to the smile |
@@ -393,7 +394,7 @@ async def device_test(self, smile=pw_smile.Smile, testdata=None, preset=False): |
393 | 394 | self._write_json("all_data", data) |
394 | 395 | self._write_json("notifications", extra["notifications"]) |
395 | 396 |
|
396 | | - location_list = smile._thermo_locs # pylint: disable=protected-access |
| 397 | + location_list = smile._thermo_locs |
397 | 398 |
|
398 | 399 | _LOGGER.info("Gateway id = %s", extra["gateway_id"]) |
399 | 400 | _LOGGER.info("Hostname = %s", smile.smile_hostname) |
@@ -639,12 +640,12 @@ async def test_connect_legacy_anna(self): |
639 | 640 | _LOGGER.info(" # Assert version") |
640 | 641 | assert smile.smile_version[0] == "1.8.0" |
641 | 642 | _LOGGER.info(" # Assert legacy") |
642 | | - assert smile._smile_legacy # pylint: disable=protected-access |
| 643 | + assert smile._smile_legacy |
643 | 644 |
|
644 | 645 | await self.device_test(smile, testdata) |
645 | 646 | _LOGGER.info(" # Assert master thermostat") |
646 | | - assert smile._is_thermostat # pylint: disable=protected-access |
647 | | - assert not smile._multi_thermostats # pylint: disable=protected-access |
| 647 | + assert smile._is_thermostat |
| 648 | + assert not smile._multi_thermostats |
648 | 649 | assert self.active_device_present |
649 | 650 | assert not self.notifications |
650 | 651 |
|
@@ -740,12 +741,12 @@ async def test_connect_legacy_anna_2(self): |
740 | 741 | _LOGGER.info(" # Assert version") |
741 | 742 | assert smile.smile_version[0] == "1.8.0" |
742 | 743 | _LOGGER.info(" # Assert legacy") |
743 | | - assert smile._smile_legacy # pylint: disable=protected-access |
| 744 | + assert smile._smile_legacy |
744 | 745 |
|
745 | 746 | await self.device_test(smile, testdata) |
746 | 747 | _LOGGER.info(" # Assert master thermostat") |
747 | | - assert smile._is_thermostat # pylint: disable=protected-access |
748 | | - assert not smile._multi_thermostats # pylint: disable=protected-access |
| 748 | + assert smile._is_thermostat |
| 749 | + assert not smile._multi_thermostats |
749 | 750 | assert self.active_device_present |
750 | 751 | assert not self.notifications |
751 | 752 |
|
@@ -812,12 +813,12 @@ async def test_connect_smile_p1_v2(self): |
812 | 813 | _LOGGER.info(" # Assert version") |
813 | 814 | assert smile.smile_version[0] == "2.5.9" |
814 | 815 | _LOGGER.info(" # Assert legacy") |
815 | | - assert smile._smile_legacy # pylint: disable=protected-access |
| 816 | + assert smile._smile_legacy |
816 | 817 |
|
817 | 818 | await self.device_test(smile, testdata) |
818 | 819 | _LOGGER.info(" # Assert no master thermostat") |
819 | 820 | # it's not a thermostat :) |
820 | | - assert not smile._is_thermostat # pylint: disable=protected-access |
| 821 | + assert not smile._is_thermostat |
821 | 822 | assert not self.notifications |
822 | 823 |
|
823 | 824 | await smile.close_connection() |
@@ -850,12 +851,12 @@ async def test_connect_smile_p1_v2_2(self): |
850 | 851 | _LOGGER.info(" # Assert version") |
851 | 852 | assert smile.smile_version[0] == "2.5.9" |
852 | 853 | _LOGGER.info(" # Assert legacy") |
853 | | - assert smile._smile_legacy # pylint: disable=protected-access |
| 854 | + assert smile._smile_legacy |
854 | 855 |
|
855 | 856 | await self.device_test(smile, testdata) |
856 | 857 | _LOGGER.info(" # Assert no master thermostat") |
857 | 858 | # it's not a thermostat :) |
858 | | - assert not smile._is_thermostat # pylint: disable=protected-access |
| 859 | + assert not smile._is_thermostat |
859 | 860 | assert not self.notifications |
860 | 861 |
|
861 | 862 | await smile.close_connection() |
@@ -932,12 +933,12 @@ async def test_connect_anna_v4(self): |
932 | 933 | _LOGGER.info(" # Assert version") |
933 | 934 | assert smile.smile_version[0] == "4.0.15" |
934 | 935 | _LOGGER.info(" # Assert no legacy") |
935 | | - assert not smile._smile_legacy # pylint: disable=protected-access |
| 936 | + assert not smile._smile_legacy |
936 | 937 |
|
937 | 938 | await self.device_test(smile, testdata) |
938 | 939 | _LOGGER.info(" # Assert master thermostat") |
939 | | - assert smile._is_thermostat # pylint: disable=protected-access |
940 | | - assert not smile._multi_thermostats # pylint: disable=protected-access |
| 940 | + assert smile._is_thermostat |
| 941 | + assert not smile._multi_thermostats |
941 | 942 | assert self.active_device_present |
942 | 943 | assert not self.notifications |
943 | 944 |
|
@@ -978,12 +979,12 @@ async def test_connect_anna_v4_no_tag(self): |
978 | 979 | _LOGGER.info(" # Assert version") |
979 | 980 | assert smile.smile_version[0] == "4.0.15" |
980 | 981 | _LOGGER.info(" # Assert no legacy") |
981 | | - assert not smile._smile_legacy # pylint: disable=protected-access |
| 982 | + assert not smile._smile_legacy |
982 | 983 |
|
983 | 984 | await self.device_test(smile, testdata) |
984 | 985 | _LOGGER.info(" # Assert master thermostat") |
985 | | - assert smile._is_thermostat # pylint: disable=protected-access |
986 | | - assert not smile._multi_thermostats # pylint: disable=protected-access |
| 986 | + assert smile._is_thermostat |
| 987 | + assert not smile._multi_thermostats |
987 | 988 |
|
988 | 989 | await self.tinker_thermostat( |
989 | 990 | smile, |
@@ -1030,12 +1031,12 @@ async def test_connect_anna_without_boiler_fw3(self): |
1030 | 1031 | _LOGGER.info(" # Assert version") |
1031 | 1032 | assert smile.smile_version[0] == "3.1.11" |
1032 | 1033 | _LOGGER.info(" # Assert no legacy") |
1033 | | - assert not smile._smile_legacy # pylint: disable=protected-access |
| 1034 | + assert not smile._smile_legacy |
1034 | 1035 |
|
1035 | 1036 | await self.device_test(smile, testdata) |
1036 | 1037 | _LOGGER.info(" # Assert master thermostat") |
1037 | | - assert smile._is_thermostat # pylint: disable=protected-access |
1038 | | - assert not smile._multi_thermostats # pylint: disable=protected-access |
| 1038 | + assert smile._is_thermostat |
| 1039 | + assert not smile._multi_thermostats |
1039 | 1040 | assert self.active_device_present |
1040 | 1041 | assert not self.notifications |
1041 | 1042 |
|
@@ -1080,12 +1081,12 @@ async def test_connect_anna_without_boiler_fw4(self): |
1080 | 1081 | _LOGGER.info(" # Assert version") |
1081 | 1082 | assert smile.smile_version[0] == "4.0.15" |
1082 | 1083 | _LOGGER.info(" # Assert no legacy") |
1083 | | - assert not smile._smile_legacy # pylint: disable=protected-access |
| 1084 | + assert not smile._smile_legacy |
1084 | 1085 |
|
1085 | 1086 | await self.device_test(smile, testdata) |
1086 | 1087 | _LOGGER.info(" # Assert master thermostat") |
1087 | | - assert smile._is_thermostat # pylint: disable=protected-access |
1088 | | - assert not smile._multi_thermostats # pylint: disable=protected-access |
| 1088 | + assert smile._is_thermostat |
| 1089 | + assert not smile._multi_thermostats |
1089 | 1090 | assert self.active_device_present |
1090 | 1091 | assert not self.notifications |
1091 | 1092 |
|
@@ -1167,12 +1168,12 @@ async def test_connect_anna_without_boiler_fw42(self): |
1167 | 1168 | _LOGGER.info(" # Assert version") |
1168 | 1169 | assert smile.smile_version[0] == "4.2.1" |
1169 | 1170 | _LOGGER.info(" # Assert no legacy") |
1170 | | - assert not smile._smile_legacy # pylint: disable=protected-access |
| 1171 | + assert not smile._smile_legacy |
1171 | 1172 |
|
1172 | 1173 | await self.device_test(smile, testdata) |
1173 | 1174 | _LOGGER.info(" # Assert master thermostat") |
1174 | | - assert smile._is_thermostat # pylint: disable=protected-access |
1175 | | - assert not smile._multi_thermostats # pylint: disable=protected-access |
| 1175 | + assert smile._is_thermostat |
| 1176 | + assert not smile._multi_thermostats |
1176 | 1177 | assert self.active_device_present |
1177 | 1178 | assert not self.notifications |
1178 | 1179 |
|
@@ -1228,12 +1229,12 @@ async def test_connect_adam_plus_anna(self): |
1228 | 1229 | _LOGGER.info(" # Assert version") |
1229 | 1230 | assert smile.smile_version[0] == "3.0.15" |
1230 | 1231 | _LOGGER.info(" # Assert legacy") |
1231 | | - assert not smile._smile_legacy # pylint: disable=protected-access |
| 1232 | + assert not smile._smile_legacy |
1232 | 1233 |
|
1233 | 1234 | await self.device_test(smile, testdata) |
1234 | 1235 | _LOGGER.info(" # Assert master thermostat") |
1235 | | - assert smile._is_thermostat # pylint: disable=protected-access |
1236 | | - assert not smile._multi_thermostats # pylint: disable=protected-access |
| 1236 | + assert smile._is_thermostat |
| 1237 | + assert not smile._multi_thermostats |
1237 | 1238 | assert self.active_device_present |
1238 | 1239 | assert not self.notifications |
1239 | 1240 |
|
@@ -1427,12 +1428,12 @@ async def test_connect_adam_plus_anna_new(self): |
1427 | 1428 | _LOGGER.info(" # Assert version") |
1428 | 1429 | assert smile.smile_version[0] == "3.6.4" |
1429 | 1430 | _LOGGER.info(" # Assert legacy") |
1430 | | - assert not smile._smile_legacy # pylint: disable=protected-access |
| 1431 | + assert not smile._smile_legacy |
1431 | 1432 |
|
1432 | 1433 | await self.device_test(smile, testdata) |
1433 | 1434 | _LOGGER.info(" # Assert master thermostat") |
1434 | | - assert smile._is_thermostat # pylint: disable=protected-access |
1435 | | - assert smile._multi_thermostats # pylint: disable=protected-access |
| 1435 | + assert smile._is_thermostat |
| 1436 | + assert smile._multi_thermostats |
1436 | 1437 | assert self.active_device_present |
1437 | 1438 |
|
1438 | 1439 | switch_change = await self.tinker_switch( |
@@ -1574,12 +1575,12 @@ async def test_connect_adam_zone_per_device(self): |
1574 | 1575 | _LOGGER.info(" # Assert version") |
1575 | 1576 | assert smile.smile_version[0] == "3.0.15" |
1576 | 1577 | _LOGGER.info(" # Assert legacy") |
1577 | | - assert not smile._smile_legacy # pylint: disable=protected-access |
| 1578 | + assert not smile._smile_legacy |
1578 | 1579 |
|
1579 | 1580 | await self.device_test(smile, testdata) |
1580 | 1581 | _LOGGER.info(" # Assert master thermostat") |
1581 | | - assert smile._is_thermostat # pylint: disable=protected-access |
1582 | | - assert smile._multi_thermostats # pylint: disable=protected-access |
| 1582 | + assert smile._is_thermostat |
| 1583 | + assert smile._multi_thermostats |
1583 | 1584 | assert self.active_device_present |
1584 | 1585 |
|
1585 | 1586 | assert "af82e4ccf9c548528166d38e560662a4" in self.notifications |
@@ -1979,12 +1980,12 @@ async def test_connect_adam_multiple_devices_per_zone(self): |
1979 | 1980 | _LOGGER.info(" # Assert version") |
1980 | 1981 | assert smile.smile_version[0] == "3.0.15" |
1981 | 1982 | _LOGGER.info(" # Assert legacy") |
1982 | | - assert not smile._smile_legacy # pylint: disable=protected-access |
| 1983 | + assert not smile._smile_legacy |
1983 | 1984 |
|
1984 | 1985 | await self.device_test(smile, testdata) |
1985 | 1986 | _LOGGER.info(" # Assert master thermostat") |
1986 | | - assert smile._is_thermostat # pylint: disable=protected-access |
1987 | | - assert smile._multi_thermostats # pylint: disable=protected-access |
| 1987 | + assert smile._is_thermostat |
| 1988 | + assert smile._multi_thermostats |
1988 | 1989 | assert self.active_device_present |
1989 | 1990 |
|
1990 | 1991 | assert "af82e4ccf9c548528166d38e560662a4" in self.notifications |
@@ -2079,11 +2080,11 @@ async def test_connect_p1v3(self): |
2079 | 2080 | assert smile.smile_type == "power" |
2080 | 2081 | _LOGGER.info(" # Assert version") |
2081 | 2082 | assert smile.smile_version[0] == "3.3.6" |
2082 | | - assert not smile._smile_legacy # pylint: disable=protected-access |
| 2083 | + assert not smile._smile_legacy |
2083 | 2084 |
|
2084 | 2085 | await self.device_test(smile, testdata) |
2085 | 2086 | # it's not a thermostat :) |
2086 | | - assert not smile._is_thermostat # pylint: disable=protected-access |
| 2087 | + assert not smile._is_thermostat |
2087 | 2088 | assert not self.cooling_present |
2088 | 2089 | assert not self.notifications |
2089 | 2090 |
|
@@ -2115,12 +2116,12 @@ async def test_connect_p1v3solarfake(self): |
2115 | 2116 | _LOGGER.info(" # Assert version") |
2116 | 2117 | assert smile.smile_version[0] == "3.3.6" |
2117 | 2118 | _LOGGER.info(" # Assert no legacy") |
2118 | | - assert not smile._smile_legacy # pylint: disable=protected-access |
| 2119 | + assert not smile._smile_legacy |
2119 | 2120 |
|
2120 | 2121 | await self.device_test(smile, testdata) |
2121 | 2122 | _LOGGER.info(" # Assert nomaster thermostat") |
2122 | 2123 | # it's not a thermostat :) |
2123 | | - assert not smile._is_thermostat # pylint: disable=protected-access |
| 2124 | + assert not smile._is_thermostat |
2124 | 2125 | assert not self.notifications |
2125 | 2126 |
|
2126 | 2127 | await smile.close_connection() |
@@ -2169,12 +2170,12 @@ async def test_connect_p1v3_full_option(self): |
2169 | 2170 | _LOGGER.info(" # Assert version") |
2170 | 2171 | assert smile.smile_version[0] == "3.3.9" |
2171 | 2172 | _LOGGER.info(" # Assert legacy") |
2172 | | - assert not smile._smile_legacy # pylint: disable=protected-access |
| 2173 | + assert not smile._smile_legacy |
2173 | 2174 |
|
2174 | 2175 | await self.device_test(smile, testdata) |
2175 | 2176 | _LOGGER.info(" # Assert no master thermostat") |
2176 | 2177 | # it's not a thermostat :) |
2177 | | - assert not smile._is_thermostat # pylint: disable=protected-access |
| 2178 | + assert not smile._is_thermostat |
2178 | 2179 | assert not self.notifications |
2179 | 2180 |
|
2180 | 2181 | await smile.close_connection() |
@@ -2222,13 +2223,13 @@ async def test_connect_anna_heatpump(self): |
2222 | 2223 | _LOGGER.info(" # Assert version") |
2223 | 2224 | assert smile.smile_version[0] == "4.0.15" |
2224 | 2225 | _LOGGER.info(" # Assert no legacy") |
2225 | | - assert not smile._smile_legacy # pylint: disable=protected-access |
| 2226 | + assert not smile._smile_legacy |
2226 | 2227 |
|
2227 | 2228 | # Preset cooling_active to True, will turn to False due to the lowered outdoor temp |
2228 | 2229 | await self.device_test(smile, testdata, True) |
2229 | 2230 | _LOGGER.info(" # Assert master thermostat") |
2230 | | - assert smile._is_thermostat # pylint: disable=protected-access |
2231 | | - assert not smile._multi_thermostats # pylint: disable=protected-access |
| 2231 | + assert smile._is_thermostat |
| 2232 | + assert not smile._multi_thermostats |
2232 | 2233 | assert self.active_device_present |
2233 | 2234 | assert self.cooling_present |
2234 | 2235 | assert not self.notifications |
@@ -2278,12 +2279,12 @@ async def test_connect_anna_heatpump_cooling(self): |
2278 | 2279 | _LOGGER.info(" # Assert version") |
2279 | 2280 | assert smile.smile_version[0] == "4.0.15" |
2280 | 2281 | _LOGGER.info(" # Assert no legacy") |
2281 | | - assert not smile._smile_legacy # pylint: disable=protected-access |
| 2282 | + assert not smile._smile_legacy |
2282 | 2283 |
|
2283 | 2284 | await self.device_test(smile, testdata) |
2284 | 2285 | _LOGGER.info(" # Assert master thermostat") |
2285 | | - assert smile._is_thermostat # pylint: disable=protected-access |
2286 | | - assert not smile._multi_thermostats # pylint: disable=protected-access |
| 2286 | + assert smile._is_thermostat |
| 2287 | + assert not smile._multi_thermostats |
2287 | 2288 | assert self.active_device_present |
2288 | 2289 | assert self.cooling_present |
2289 | 2290 | assert not self.notifications |
@@ -2311,12 +2312,12 @@ async def test_connect_adam_plus_anna_copy_with_error_domain_added(self): |
2311 | 2312 | _LOGGER.info(" # Assert version") |
2312 | 2313 | assert smile.smile_version[0] == "3.0.23" |
2313 | 2314 | _LOGGER.info(" # Assert legacy") |
2314 | | - assert not smile._smile_legacy # pylint: disable=protected-access |
| 2315 | + assert not smile._smile_legacy |
2315 | 2316 |
|
2316 | 2317 | await self.device_test(smile, testdata, True) |
2317 | 2318 | _LOGGER.info(" # Assert master thermostat") |
2318 | | - assert smile._is_thermostat # pylint: disable=protected-access |
2319 | | - assert not smile._multi_thermostats # pylint: disable=protected-access |
| 2319 | + assert smile._is_thermostat |
| 2320 | + assert not smile._multi_thermostats |
2320 | 2321 |
|
2321 | 2322 | assert "3d28a20e17cb47dca210a132463721d5" in self.notifications |
2322 | 2323 |
|
@@ -2504,12 +2505,12 @@ async def test_connect_stretch_v31(self): |
2504 | 2505 | _LOGGER.info(" # Assert version") |
2505 | 2506 | assert smile.smile_version[0] == "3.1.11" |
2506 | 2507 | _LOGGER.info(" # Assert legacy") |
2507 | | - assert smile._smile_legacy # pylint: disable=protected-access |
| 2508 | + assert smile._smile_legacy |
2508 | 2509 |
|
2509 | 2510 | await self.device_test(smile, testdata) |
2510 | 2511 | _LOGGER.info(" # Assert no master thermostat") |
2511 | 2512 | # it's not a thermostat :) |
2512 | | - assert not smile._is_thermostat # pylint: disable=protected-access |
| 2513 | + assert not smile._is_thermostat |
2513 | 2514 |
|
2514 | 2515 | await smile.close_connection() |
2515 | 2516 | await self.disconnect(server, client) |
@@ -2781,12 +2782,12 @@ async def test_connect_stretch_v23(self): |
2781 | 2782 | _LOGGER.info(" # Assert version") |
2782 | 2783 | assert smile.smile_version[0] == "2.3.12" |
2783 | 2784 | _LOGGER.info(" # Assert legacy") |
2784 | | - assert smile._smile_legacy # pylint: disable=protected-access |
| 2785 | + assert smile._smile_legacy |
2785 | 2786 |
|
2786 | 2787 | await self.device_test(smile, testdata) |
2787 | 2788 | _LOGGER.info(" # Assert no master thermostat") |
2788 | 2789 | # it's not a thermostat :) |
2789 | | - assert not smile._is_thermostat # pylint: disable=protected-access |
| 2790 | + assert not smile._is_thermostat |
2790 | 2791 |
|
2791 | 2792 | switch_change = await self.tinker_switch( |
2792 | 2793 | smile, "2587a7fcdd7e482dab03fda256076b4b" |
@@ -2830,12 +2831,12 @@ async def test_connect_stretch_v27_no_domain(self): |
2830 | 2831 | _LOGGER.info(" # Assert version") |
2831 | 2832 | assert smile.smile_version[0] == "2.7.18" |
2832 | 2833 | _LOGGER.info(" # Assert legacy") |
2833 | | - assert smile._smile_legacy # pylint: disable=protected-access |
| 2834 | + assert smile._smile_legacy |
2834 | 2835 |
|
2835 | 2836 | await self.device_test(smile, testdata) |
2836 | 2837 | _LOGGER.info(" # Assert no master thermostat") |
2837 | 2838 | # it's not a thermostat :) |
2838 | | - assert not smile._is_thermostat # pylint: disable=protected-access |
| 2839 | + assert not smile._is_thermostat |
2839 | 2840 |
|
2840 | 2841 | switch_change = await self.tinker_switch( |
2841 | 2842 | smile, "8b8d14b242e24cd789743c828b9a2ea9" |
@@ -2886,12 +2887,12 @@ async def test_connect_p1v4(self): |
2886 | 2887 | _LOGGER.info(" # Assert version") |
2887 | 2888 | assert smile.smile_version[0] == "4.1.1" |
2888 | 2889 | _LOGGER.info(" # Assert legacy") |
2889 | | - assert not smile._smile_legacy # pylint: disable=protected-access |
| 2890 | + assert not smile._smile_legacy |
2890 | 2891 |
|
2891 | 2892 | await self.device_test(smile, testdata) |
2892 | 2893 | _LOGGER.info(" # Assert no master thermostat") |
2893 | 2894 | # it's not a thermostat :) |
2894 | | - assert not smile._is_thermostat # pylint: disable=protected-access |
| 2895 | + assert not smile._is_thermostat |
2895 | 2896 | assert not self.notifications |
2896 | 2897 |
|
2897 | 2898 | await smile.close_connection() |
|
0 commit comments