Skip to content

Commit 0fb46bc

Browse files
authored
Merge pull request #377 from plugwise/p1v4_442_triple-notify
Add Plugwise-notification to test-fixture used in Core/PW-beta
2 parents 0412862 + 1af2a63 commit 0fb46bc

File tree

5 files changed

+31
-7
lines changed

5 files changed

+31
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Ongoing
4+
5+
- Extend p1v4_442_triple userdata to include a Plugwise notification, extending the related fixture which is used in PW-beta and Core Plugwise.
6+
37
## v0.32.1 Improve typing, bugfix
48

59
- Integrate the process of creating binary_sensors, sensors, and switches dicts. Should make typing simpler.

fixtures/p1v4_442_triple/all_data.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"devices": {
33
"03e65b16e4b247a29ae0d75a78cb492e": {
44
"binary_sensors": {
5-
"plugwise_notification": false
5+
"plugwise_notification": true
66
},
77
"dev_class": "gateway",
88
"firmware": "4.4.2",
@@ -14,7 +14,7 @@
1414
"vendor": "Plugwise"
1515
},
1616
"b82b6b3322484f2ea4e25e0bd5f3d61f": {
17-
"available": true,
17+
"available": false,
1818
"dev_class": "smartmeter",
1919
"location": "03e65b16e4b247a29ae0d75a78cb492e",
2020
"model": "XMX5LGF0010453051839",
@@ -51,7 +51,11 @@
5151
},
5252
"gateway": {
5353
"gateway_id": "03e65b16e4b247a29ae0d75a78cb492e",
54-
"notifications": {},
54+
"notifications": {
55+
"97a04c0c263049b29350a660b4cdd01e": {
56+
"warning": "The Smile P1 does not seem to be connected to a smart meter."
57+
}
58+
},
5559
"smile_name": "Smile P1"
5660
}
5761
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
{}
1+
{
2+
"97a04c0c263049b29350a660b4cdd01e": {
3+
"warning": "The Smile P1 does not seem to be connected to a smart meter."
4+
}
5+
}

tests/test_smile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5190,15 +5190,15 @@ async def test_connect_p1v4_442_triple(self):
51905190
"model": "Gateway",
51915191
"name": "Smile P1",
51925192
"vendor": "Plugwise",
5193-
"binary_sensors": {"plugwise_notification": False},
5193+
"binary_sensors": {"plugwise_notification": True},
51945194
},
51955195
"b82b6b3322484f2ea4e25e0bd5f3d61f": {
51965196
"dev_class": "smartmeter",
51975197
"location": "03e65b16e4b247a29ae0d75a78cb492e",
51985198
"model": "XMX5LGF0010453051839",
51995199
"name": "P1",
52005200
"vendor": "XEMEX NV",
5201-
"available": True,
5201+
"available": False,
52025202
"sensors": {
52035203
"net_electricity_point": 5553,
52045204
"electricity_consumed_peak_point": 0,
@@ -5244,7 +5244,7 @@ async def test_connect_p1v4_442_triple(self):
52445244
await self.device_test(smile, testdata)
52455245
assert smile.gateway_id == "03e65b16e4b247a29ae0d75a78cb492e"
52465246
assert self.device_items == 40
5247-
assert not self.notifications
5247+
assert self.notifications
52485248

52495249
await smile.close_connection()
52505250
await self.disconnect(server, client)

userdata/p1v4_442_triple/core.domain_objects.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,18 @@
432432
</dsmr_gas>
433433
</protocols>
434434
</module>
435+
<notification id='97a04c0c263049b29350a660b4cdd01e'>
436+
<type>warning</type>
437+
<origin>local</origin>
438+
<title>Smart meter not found.</title>
439+
<message>The Smile P1 does not seem to be connected to a smart meter.</message>
440+
<valid_from></valid_from>
441+
<valid_to></valid_to>
442+
<read_date>2020-01-23T10:54:59.710+01:00</read_date>
443+
<created_date>2020-01-18T23:03:43.689+01:00</created_date>
444+
<modified_date>2020-01-18T23:03:43.749+01:00</modified_date>
445+
<deleted_date></deleted_date>
446+
</notification>
435447
<module id='b0ea732032ce4656a5c409ca3903c1a2'>
436448
<vendor_name>Plugwise</vendor_name>
437449
<vendor_model>Gateway</vendor_model>

0 commit comments

Comments
 (0)