8000 Add commit-hook to prettify JSON files (#1455) · Fulch36/python-kasa@0f185f1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0f185f1

Browse files
authored
Add commit-hook to prettify JSON files (python-kasa#1455)
1 parent 2ab42f5 commit 0f185f1

File tree

7 files changed

+577
-556
lines changed

7 files changed

+577
-556
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ repos:
1616
- id: check-yaml
1717
- id: debug-statements
1818
- id: check-ast
19+
- id: pretty-format-json
20+
args:
21+
- "--autofix"
22+
- "--indent=4"
1923

2024
- repo: https://github.com/astral-sh/ruff-pre-commit
2125
rev: v0.7.4
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"host": "127.0.0.1",
3-
"timeout": 5,
42
"connection_type": {
53
"device_family": "SMART.IPCAMERA",
64
"encryption_type": "AES",
75
"https": true
8-
}
6+
},
7+
"host": "127.0.0.1",
8+
"timeout": 5
99
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"host": "127.0.0.1",
3-
"timeout": 5,
42
"connection_type": {
53
"device_family": "SMART.TAPOPLUG",
64
"encryption_type": "KLAP",
75
"https": false,
86
"login_version": 2
9-
}
7+
},
8+
"host": "127.0.0.1",
9+
"timeout": 5
1010
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"host": "127.0.0.1",
3-
"timeout": 5,
42
"connection_type": {
53
"device_family": "IOT.SMARTPLUGSWITCH",
64
"encryption_type": "XOR",
75
"https": false
8-
}
6+
},
7+
"host": "127.0.0.1",
8+
"timeout": 5
99
}

tests/fixtures/smart/RV20 Max Plus(EU)_1.0_1.0.7.json

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@
150150
"owner": "00000000000000000000000000000000"
151151
}
152152
},
153+
"getAreaUnit": {
154+
"area_unit": 0
155+
},
153156
"getAutoChangeMap": {
154157
"auto_change_map": false
155158
},
@@ -159,10 +162,16 @@
159162
"getBatteryInfo": {
160163
"battery_percentage": 75
161164
},
162-
"getAreaUnit": {"area_unit": 0},
163-
"getCleanAttr": {"suction": 2, "cistern": 2, "clean_number": 1},
164-
"getCleanInfo": {"clean_time": 5, "clean_area": 5, "clean_percent": 1},
165-
"getCleanStatus": {"getCleanStatus": {"clean_status": 0, "is_working": false, "is_mapping": false, "is_relocating": false}},
165+
"getCleanAttr": {
166+
"cistern": 2,
167+
"clean_number": 1,
168+
"suction": 2
169+
},
170+
"getCleanInfo": {
171+
"clean_area": 5,
172+
"clean_percent": 1,
173+
"clean_time": 5
174+
},
166175
"getCleanRecords": {
167176
"lastest_day_record": [
168177
0,
@@ -176,6 +185,14 @@
176185
"total_number": 0,
177186
"total_time": 0
178187
},
188+
"getCleanStatus": {
189+
"getCleanStatus": {
190+
"clean_status": 0,
191+
"is_mapping": false,
192+
"is_relocating": false,
193+
"is_working": false
194+
}
195+
},
179196
"getConsumablesInfo": {
180197
"charge_contact_time": 0,
181198
"edge_brush_time": 0,
@@ -189,14 +206,15 @@
189206
"name": "2",
190207
"version": 1
191208
},
192-
"getVolume": {
193-
"volume": 84
194-
},
195209
"getDoNotDisturb": {
196210
"do_not_disturb": true,
197211
"e_min": 480,
198212
"s_min": 1320
199213
},
214+
"getDustCollectionInfo": {
215+
"auto_dust_collection": true,
216+
"dust_collection_mode": 0
217+
},
200218
"getMapInfo": {
201219 "auto_change_map": false,
202220
"current_map_id": 0,
@@ -207,10 +225,6 @@
207225
"getMopState": {
208226
"mop_state": false
209227
},
210-
"getDustCollectionInfo": {
211-
"auto_dust_collection": true,
212-
"dust_collection_mode": 0
213-
},
214228
"getVacStatus": {
215229
"err_status": [
216230
0
@@ -222,6 +236,9 @@
222236
"promptCode_id": [],
223237
"status": 5
224238
},
239+
"getVolume": {
240+
"volume": 84
241+
},
225242
"get_device_info": {
226243
"auto_pack_ver": "0.0.1.1771",
227244
"avatar": "",

tests/fixtures/smart/child/T310(EU)_1.0_1.5.0.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"component_nego" : {
2+
"component_nego": {
33
"component_list": [
44
{
55
"id": "device",

0 commit comments

Comments
 (0)
0