Skip to content

Commit 47ca166

Browse files
committed
Update P1 test with data missing after a reboot
Try
1 parent a1dd80a commit 47ca166

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

plugwise/helper.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,9 @@ def _all_appliances(self) -> None:
337337

338338
self._create_gw_entities(appl)
339339

340+
######################################################
341+
#TODO: at this indent appl is not available/defined!!#
342+
######################################################
340343
# For P1 collect the connected SmartMeter info
341344
if self.smile_type == "power":
342345
self._p1_smartmeter_info_finder(appl)

tests/test_adam.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ async def test_connect_adam_plus_anna_new(self):
137137
self.smile_setup = "reboot/adam_plus_anna_new"
138138
try:
139139
await self.device_test(smile, initialize=False)
140-
except pw_exceptions.PlugwiseError:
141-
_LOGGER.debug("Receiving no data after a reboot is properly handled")
140+
except pw_exceptions.PlugwiseError as err:
141+
_LOGGER.debug(f"Receiving no data after a reboot is properly handled: {err}")
142142

143143
# Simulate receiving xml-data with <error>
144144
self.smile_setup = "error/adam_plus_anna_new"

tests/test_p1.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ async def test_connect_p1v4_442_single(self):
4141
smile, "2022-05-16 00:00:01", testdata_updated, initialize=False
4242
)
4343

44+
# Simulate receiving no xml-data after a requesting a reboot of the gateway
45+
self.smile_setup = "reboot/p1v4_442_single"
46+
try:
47+
await self.device_test(smile, initialize=False)
48+
except pw_exceptions.PlugwiseError as err:
49+
_LOGGER.debug(f"Receiving no data after a reboot is properly handled: {err}")
50+
4451
# Simulate receiving xml-data with <error>
4552
self.smile_setup = "error/p1v4_442_single"
4653
try:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<domain_objects>
3+
</domain_objects>

0 commit comments

Comments
 (0)