-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add test_retrieve_blutrv_components * ID should be int * More tests * Coverage * More tests * Coverage * Fixtures * Add test_device_initialize * Do not mock rpc_call * BLU Gateway fixtures * Use ConnectionOptions * More tests * More tests * Add test_get_all_pages * More tests * Even more tests * A few more tests * Cleaning * Fix RpcCallError * Improve test_device_exception_on_init
- Loading branch information
Showing
9 changed files
with
985 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,8 @@ lint.ignore = [ | |
"D102", | ||
"D103", | ||
"D104", | ||
"PLR0913", | ||
"PLR2004", | ||
"S101", | ||
"SLF001", | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
tests/rpc_device/fixtures/shellyblugatewaygen3/BluTrv.GetRemoteConfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"v": 14, | ||
"ts": 1739221213, | ||
"config": { | ||
"sys": { | ||
"device": { | ||
"name": "" | ||
}, | ||
"location": { | ||
"lat": 11.1111, | ||
"lon": 22.2222 | ||
}, | ||
"ui": { | ||
"lock": false, | ||
"t_units": "C", | ||
"flip": false, | ||
"brightness": 7 | ||
}, | ||
"ble": { | ||
"interval_ms": 333, | ||
"beacon_count": 5 | ||
}, | ||
"cfg_rev": 34 | ||
}, | ||
"temperature:0": { | ||
"id": 0, | ||
"offset_C": 0 | ||
}, | ||
"trv:0": { | ||
"id": 0, | ||
"enable": true, | ||
"override_enable": true, | ||
"min_valve_position": 0, | ||
"default_boost_duration": 900, | ||
"default_override_duration": 2147483647, | ||
"default_override_target_C": 8, | ||
"flags": [ | ||
"floor_heating", | ||
"auto_calibrate", | ||
"anticlog" | ||
] | ||
} | ||
} | ||
} |
110 changes: 110 additions & 0 deletions
110
tests/rpc_device/fixtures/shellyblugatewaygen3/Shelly.GetComponents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
{ | ||
"components": [ | ||
{ | ||
"key": "blutrv:200", | ||
"status": { | ||
"id": 200, | ||
"target_C": 19, | ||
"current_C": 21, | ||
"pos": 0, | ||
"rssi": -58, | ||
"battery": 100, | ||
"packet_id": 29, | ||
"last_updated_ts": 1739224517, | ||
"paired": true, | ||
"rpc": true, | ||
"rsv": 14 | ||
}, | ||
"config": { | ||
"id": 200, | ||
"addr": "aa:bb:cc:dd:ee:ff", | ||
"name": "Shelly BLU TRV [DDEEFF]", | ||
"key": null, | ||
"trv": "bthomedevice:200", | ||
"temp_sensors": [], | ||
"dw_sensors": [], | ||
"override_delay": 30, | ||
"meta": {} | ||
}, | ||
"attrs": { | ||
"flags": 17, | ||
"model_id": 8 | ||
} | ||
}, | ||
{ | ||
"key": "bthomedevice:200", | ||
"status": { | ||
"id": 200, | ||
"rssi": -58, | ||
"battery": 100, | ||
"packet_id": 29, | ||
"last_updated_ts": 1739224517, | ||
"paired": true, | ||
"rpc": true, | ||
"rsv": 14 | ||
}, | ||
"config": { | ||
"id": 200, | ||
"addr": "aa:bb:cc:dd:ee:ff", | ||
"name": "Shelly BLU TRV [DDEEFF]", | ||
"key": null, | ||
"meta": null | ||
}, | ||
"attrs": { | ||
"flags": 17, | ||
"model_id": 8 | ||
} | ||
}, | ||
{ | ||
"key": "bthomesensor:200", | ||
"status": { | ||
"id": 200, | ||
"value": 100, | ||
"last_updated_ts": 1739224517 | ||
}, | ||
"config": { | ||
"id": 200, | ||
"addr": "aa:bb:cc:dd:ee:ff", | ||
"name": null, | ||
"obj_id": 1, | ||
"idx": 0, | ||
"meta": null | ||
} | ||
}, | ||
{ | ||
"key": "bthomesensor:202", | ||
"status": { | ||
"id": 202, | ||
"value": 19, | ||
"last_updated_ts": 1739224517 | ||
}, | ||
"config": { | ||
"id": 202, | ||
"addr": "aa:bb:cc:dd:ee:ff", | ||
"name": null, | ||
"obj_id": 69, | ||
"idx": 0, | ||
"meta": null | ||
} | ||
}, | ||
{ | ||
"key": "bthomesensor:203", | ||
"status": { | ||
"id": 203, | ||
"value": 0, | ||
"last_updated_ts": 1739224517 | ||
}, | ||
"config": { | ||
"id": 203, | ||
"addr": "aa:bb:cc:dd:ee:ff", | ||
"name": null, | ||
"obj_id": 69, | ||
"idx": 1, | ||
"meta": null | ||
} | ||
} | ||
], | ||
"cfg_rev": 32, | ||
"offset": 0, | ||
"total": 5 | ||
} |
88 changes: 88 additions & 0 deletions
88
tests/rpc_device/fixtures/shellyblugatewaygen3/Shelly.GetConfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"ble": { | ||
"enable": true, | ||
"rpc": { | ||
"enable": true | ||
} | ||
}, | ||
"blugw": { | ||
"sys_led_enable": true | ||
}, | ||
"blutrv:200": { | ||
"addr": "f8:44:77:1c:86:7e", | ||
"default_boost_duration": 900, | ||
"default_override_duration": 2147483647, | ||
"default_override_target_C": 8, | ||
"enable": true, | ||
"flags": [ | ||
"floor_heating", | ||
"auto_calibrate", | ||
"anticlog" | ||
], | ||
"id": 0, | ||
"local_name": "SBTR-001AEU", | ||
"min_valve_position": 0, | ||
"name": "Shelly BLU TRV [7744F8]", | ||
"override_enable": true | ||
}, | ||
"bthome": {}, | ||
"cloud": { | ||
"enable": false, | ||
"server": "shelly-api-eu.shelly.cloud:6022/jrpc" | ||
}, | ||
"mqtt": { | ||
"client_id": "shelly-blu-gateway-gen3-78742c", | ||
"enable": false, | ||
"enable_control": true, | ||
"enable_rpc": true, | ||
"rpc_ntf": true, | ||
"server": "mqtt.test.server", | ||
"ssl_ca": null, | ||
"status_ntf": true, | ||
"topic_prefix": "shellies-gen3/shelly-blu-gateway-gen3-78742c", | ||
"use_client_cert": false, | ||
"user": "mqtt_client" | ||
}, | ||
"sys": { | ||
"cfg_rev": 32, | ||
"debug": { | ||
"file_level": null, | ||
"level": 2, | ||
"mqtt": { | ||
"enable": false | ||
}, | ||
"udp": { | ||
"addr": null | ||
}, | ||
"websocket": { | ||
"enable": false | ||
} | ||
}, | ||
"device": { | ||
"discoverable": true, | ||
"eco_mode": false, | ||
"fw_id": "20250203-144328/1.5.0-beta2-gbf89ed5", | ||
"mac": "AABBCCDDEEFF", | ||
"name": "Test Name" | ||
}, | ||
"location": { | ||
"lat": 52.2201, | ||
"lon": 21.0121, | ||
"tz": "Europe/Warsaw" | ||
}, | ||
"rpc_udp": { | ||
"dst_addr": null, | ||
"listen_port": null | ||
}, | ||
"sntp": { | ||
"server": "sntp.test.server" | ||
}, | ||
"ui_data": {} | ||
}, | ||
"wifi": "Wifi-Network-Name", | ||
"ws": { | ||
"enable": false, | ||
"server": null, | ||
"ssl_ca": "ca.pem" | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
tests/rpc_device/fixtures/shellyblugatewaygen3/Shelly.GetDeviceInfo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "Shelly BLU Gateway Gen3 [DDEEFF]", | ||
"id": "shellyblugwg3-aabbccddeeff", | ||
"mac": "AABBCCDDEEFF", | ||
"slot": 0, | ||
"model": "S3GW-1DBT001", | ||
"gen": 3, | ||
"fw_id": "20250203-144328/1.5.0-beta2-gbf89ed5", | ||
"ver": "1.5.0-beta2", | ||
"app": "BluGwG3", | ||
"auth_en": true, | ||
"auth_domain": "shellyblugwg3-aabbccddeeff" | ||
} |
Oops, something went wrong.