Skip to content

Commit eb5d6f9

Browse files
committed
Add testcase for a blocked switchgroup-change
1 parent 0e962eb commit eb5d6f9

File tree

3 files changed

+75
-2
lines changed

3 files changed

+75
-2
lines changed

tests/data/adam/adam_multiple_devices_per_zone.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,19 @@
567567
"vendor": "Plugwise",
568568
"zigbee_mac_address": "ABCD012345670A08"
569569
},
570+
"e8ef2a01ed3b4139a53bf749204fe6b4": {
571+
"dev_class": "switching",
572+
"members": [
573+
"02cf28bfec924855854c544690a609ef",
574+
"4a810418d5394b3f82727340b91ba740"
575+
],
576+
"model": "Switchgroup",
577+
"name": "Test",
578+
"switches": {
579+
"relay": true
580+
},
581+
"vendor": "Plugwise"
582+
},
570583
"fe799307f1624099878210aa0b9f1475": {
571584
"binary_sensors": {
572585
"plugwise_notification": true

tests/test_adam.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,14 @@ async def test_connect_adam_multiple_devices_per_zone(self):
304304
smile, "675416a629f343c495449970e2ca37b5"
305305
)
306306
assert not switch_change
307+
# Test a blocked group-change, both relays are locked.
308+
group_change = await self.tinker_switch(
309+
smile,
310+
"e8ef2a01ed3b4139a53bf749204fe6b4",
311+
["02cf28bfec924855854c544690a609ef", "4a810418d5394b3f82727340b91ba740"],
312+
)
313+
assert not group_change
314+
307315
await smile.close_connection()
308316
await self.disconnect(server, client)
309317

userdata/adam_multiple_devices_per_zone/core.domain_objects.xml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,9 @@
14251425
<modified_date>2020-03-20T17:44:58.716+01:00</modified_date>
14261426
<deleted_date></deleted_date>
14271427
<location id='cd143c07248f491493cea0533bc3d669'/>
1428-
<groups/>
1428+
<groups>
1429+
<group id="e8ef2a01ed3b4139a53bf749204fe6b4"/>
1430+
</groups>
14291431
<logs>
14301432
<interval_log id='075466c308d04b2eb22d611b801703bd'>
14311433
<updated_date>2020-03-20T17:30:00+01:00</updated_date>
@@ -3146,7 +3148,9 @@
31463148
<modified_date>2020-03-20T17:39:34.219+01:00</modified_date>
31473149
<deleted_date></deleted_date>
31483150
<location id='cd143c07248f491493cea0533bc3d669'/>
3149-
<groups/>
3151+
<groups>
3152+
<group id="e8ef2a01ed3b4139a53bf749204fe6b4"/>
3153+
</groups>
31503154
<logs>
31513155
<point_log id='27388b64d1684da4b5b77740b3cddbca'>
31523156
<updated_date>2020-03-20T17:28:23.547+01:00</updated_date>
@@ -3517,6 +3521,54 @@
35173521
</relay_functionality>
35183522
</actuator_functionalities>
35193523
</appliance>
3524+
<group id='e8ef2a01ed3b4139a53bf749204fe6b4'>
3525+
<name>Test</name>
3526+
<description></description>
3527+
<type>switching</type>
3528+
<created_date>2021-12-23T08:25:07.571+01:00</created_date>
3529+
<modified_date>2023-12-22T16:29:14.088+01:00</modified_date>
3530+
<deleted_date></deleted_date>
3531+
<appliances>
3532+
<appliance id='02cf28bfec924855854c544690a609ef'/>
3533+
<appliance id='4a810418d5394b3f82727340b91ba740'/>
3534+
</appliances>
3535+
<logs>
3536+
<point_log id='40be4ec87012420e87e9639a3023214c'>
3537+
<type>relay</type>
3538+
<unit></unit>
3539+
<updated_date></updated_date>
3540+
<last_consecutive_log_date></last_consecutive_log_date>
3541+
<interval/>
3542+
</point_log>
3543+
<point_log id='516005b3d22544bf926f32034fb2a18d'>
3544+
<type>electricity_produced</type>
3545+
<unit>W</unit>
3546+
<updated_date>2023-12-22T16:29:13.997+01:00</updated_date>
3547+
<last_consecutive_log_date>2023-08-16T23:58:55.515+02:00</last_consecutive_log_date>
3548+
<interval/>
3549+
<period start_date="2023-12-22T16:29:13.997+01:00" end_date="2023-12-22T16:29:13.997+01:00">
3550+
<measurement log_date="2023-12-22T16:29:13.997+01:00">0.00</measurement>
3551+
</period>
3552+
</point_log>
3553+
<point_log id='a0b4dbf42a1240399364842a22e1cdb1'>
3554+
<type>electricity_consumed</type>
3555+
<unit>W</unit>
3556+
<updated_date>2023-12-22T16:29:13.997+01:00</updated_date>
3557+
<last_consecutive_log_date>2023-08-16T23:58:55.515+02:00</last_consecutive_log_date>
3558+
<interval/>
3559+
<period start_date="2023-12-22T16:29:13.997+01:00" end_date="2023-12-22T16:29:13.997+01:00">
3560+
<measurement log_date="2023-12-22T16:29:13.997+01:00">14.81</measurement>
3561+
</period>
3562+
</point_log>
3563+
</logs>
3564+
<actuator_functionalities>
3565+
<relay_functionality id='221f4c1a1e184ae0a1e06fc8fe187676'>
3566+
<updated_date></updated_date>
3567+
<lock>false</lock>
3568+
<delegation_strategy>single</delegation_strategy>
3569+
</relay_functionality>
3570+
</actuator_functionalities>
3571+
</group>
35203572
<rule id='3683589f956842ccb3d35d30940e3a01'>
35213573
<name></name>
35223574
<description></description>

0 commit comments

Comments
 (0)