Skip to content

Commit 5b9dd69

Browse files
committed
P1 testing update
1 parent c44aa4e commit 5b9dd69

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

tests/test_smile.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5258,6 +5258,26 @@ async def test_connect_p1v4_442_single(self):
52585258
},
52595259
},
52605260
}
5261+
testdata_updated = {
5262+
"ba4de7613517478da82dd9b6abea36af": {
5263+
"available": True,
5264+
"sensors": {
5265+
"net_electricity_point": -2248,
5266+
"electricity_consumed_peak_point": 0,
5267+
"electricity_consumed_off_peak_point": 0,
5268+
"electricity_consumed_peak_interval": 0,
5269+
"electricity_consumed_off_peak_interval": 0,
5270+
"electricity_produced_peak_point": 2248,
5271+
"electricity_produced_off_peak_point": 0,
5272+
"electricity_produced_peak_cumulative": 6543,
5273+
"electricity_produced_off_peak_cumulative": 0.0,
5274+
"electricity_produced_peak_interval": 1345,
5275+
"electricity_produced_off_peak_interval": 0,
5276+
"electricity_phase_one_consumed": 0,
5277+
"electricity_phase_one_produced": 1998,
5278+
},
5279+
},
5280+
}
52615281

52625282
self.smile_setup = "p1v4_442_single"
52635283
server, smile, client = await self.connect_wrapper()
@@ -5276,6 +5296,12 @@ async def test_connect_p1v4_442_single(self):
52765296
assert self.device_items == 31
52775297
assert not self.notifications
52785298

5299+
5300+
# Now change some data and change directory reading xml from
5301+
# emulating reading newer dataset after an update_interval
5302+
self.smile_setup = "updated/p1v4_442_single"
5303+
await self.device_test(smile, testdata_updated, initialize=False)
5304+
52795305
await smile.close_connection()
52805306
await self.disconnect(server, client)
52815307

userdata/updated/p1v4_442_single/core.locations.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<interval/>
4343
<electricity_cumulative_meter id='1fa5f5772e464e5cbcb595101adaf8e5'/>
4444
<period start_date="2022-12-24T10:08:00+01:00" end_date="2022-12-24T10:08:00+01:00">
45-
<measurement log_date="2022-12-24T10:08:00+01:00" tariff="nl_peak">2248.00</measurement>
45+
<measurement log_date="2022-12-24T10:08:00+01:00" tariff="nl_peak">6543.00</measurement>
4646
<measurement log_date="2022-12-24T10:08:00+01:00" tariff="nl_offpeak">0.00</measurement>
4747
</period>
4848
</cumulative_log>
@@ -65,7 +65,7 @@
6565
<interval/>
6666
<electricity_point_meter id='b0618815236d47a2b093a1a7ba83991d'/>
6767
<period start_date="2022-12-24T10:08:05+01:00" end_date="2022-12-24T10:08:05+01:00">
68-
<measurement log_date="2022-12-24T10:08:05+01:00" tariff="nl_peak">0.00</measurement>
68+
<measurement log_date="2022-12-24T10:08:05+01:00" tariff="nl_peak">2248.00</measurement>
6969
<measurement log_date="2022-12-24T10:08:05+01:00" tariff="nl_offpeak">0.00</measurement>
7070
</period>
7171
</point_log>
@@ -89,7 +89,7 @@
8989
<interval>PT5M</interval>
9090
<electricity_interval_meter id='b3e07d45b7354d189cd0d5d41a4f80d7'/>
9191
<period start_date="2022-12-24T10:05:00+01:00" end_date="2022-12-24T10:05:00+01:00" interval="PT5M">
92-
<measurement log_date="2022-12-24T10:05:00+01:00" tariff="nl_peak">6543.00</measurement>
92+
<measurement log_date="2022-12-24T10:05:00+01:00" tariff="nl_peak">1345.00</measurement>
9393
<measurement log_date="2022-12-24T10:05:00+01:00" tariff="nl_offpeak">0.00</measurement>
9494
</period>
9595
</interval_log>

0 commit comments

Comments
 (0)