Skip to content

Commit 895a9ba

Browse files
authored
Merge pull request #621 from plugwise/biome_part_2
Biome part 2
2 parents 901d0c0 + edb94a7 commit 895a9ba

File tree

39 files changed

+620
-117
lines changed

39 files changed

+620
-117
lines changed

.github/workflows/verify.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ jobs:
157157
run: |
158158
. venv/bin/activate
159159
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual pylint
160+
- name: Biome lint
161+
run: |
162+
. venv/bin/activate
163+
mkdir -p ./tmp && curl -sL "https://github.com/biomejs/biome/releases/latest/download/biome-linux-x64" -o ./tmp/biome && chmod +x ./tmp/biome
164+
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual biome
160165
- name: Lint markdown files
161166
run: |
162167
. venv/bin/activate

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ tests/__pycache__
1212
.vscode
1313
venv
1414
*.sedbck
15-
tmp
1615
.mypy_cache
17-
node_modules/
18-
package-lock.json
1916
fixtures/updated/*/
17+
tmp

.pre-commit-config.yaml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ci:
22
# Defer autoupdate to quarterly (there is no 'off' button) to have renovate pick up first
33
autoupdate_schedule: quarterly
4-
skip: [pylint, markdownlint, testing]
4+
skip: [setup, setup_test, pylint, markdownlint, testing, biome]
55
submodules: true
66

77
default_language_version:
@@ -67,6 +67,14 @@ repos:
6767
# pyenv and/or virtualenv activated; it may not have been e.g. if
6868
# committing from a GUI tool that was not launched from an activated
6969
# shell.
70+
- id: setup
71+
name: Setup python
72+
entry: /usr/bin/env bash -c 'test -d ./venv || scripts/setup.sh'
73+
language: script
74+
- id: setup_test
75+
name: Setup testing
76+
entry: /usr/bin/env bash -c 'test -f ./tmp/biome || scripts/setup_test.sh pre-commit'
77+
language: script
7078
- id: userdata
7179
name: userdata
7280
entry: scripts/pre-commit.sh
@@ -92,12 +100,10 @@ repos:
92100
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" scripts/tests_and_coverage.sh test_and_coverage'
93101
language: script
94102
pass_filenames: false
95-
- repo: https://github.com/biomejs/pre-commit
96-
rev: v0.5.0
97-
hooks:
98-
- id: biome-lint
99-
additional_dependencies: ["@biomejs/[email protected]"]
100-
name: "Verifying/updating code with biome (improved prettier)"
103+
- id: biome
104+
name: "Local Linting - Biome"
105+
entry: ./tmp/biome lint --staged --files-ignore-unknown=true --no-errors-on-unmatched
106+
language: script
101107
- repo: https://github.com/igorshubovych/markdownlint-cli
102108
rev: v0.41.0
103109
hooks:

CHANGELOG.md

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

3+
## v1.4.1
4+
5+
- Prettying documents with Biome (CLI), fixture layout updated accordingly.
6+
37
## v1.4.0
48

59
- Improve model_id implementation, allow direct access to the gateway `smile_model_id`.

fixtures/adam_heatpump_cooling/all_data.json

Lines changed: 75 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@
6060
"model": "Lisa",
6161
"model_id": "158-01",
6262
"name": "Thermostaat BK",
63-
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
63+
"preset_modes": [
64+
"no_frost",
65+
"vacation",
66+
"away",
67+
"home",
68+
"asleep"
69+
],
6470
"select_schedule": "off",
6571
"sensors": {
6672
"battery": 55,
@@ -180,7 +186,13 @@
180186
"model": "Lisa",
181187
"model_id": "158-01",
182188
"name": "Thermostaat DB",
183-
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
189+
"preset_modes": [
190+
"no_frost",
191+
"vacation",
192+
"away",
193+
"home",
194+
"asleep"
195+
],
184196
"select_schedule": "off",
185197
"sensors": {
186198
"setpoint": 18.0,
@@ -227,7 +239,11 @@
227239
},
228240
"dev_class": "gateway",
229241
"firmware": "3.2.8",
230-
"gateway_modes": ["away", "full", "vacation"],
242+
"gateway_modes": [
243+
"away",
244+
"full",
245+
"vacation"
246+
],
231247
"hardware": "AME Smile 2.0 board",
232248
"location": "eedadcb297564f1483faa509179aebed",
233249
"mac_address": "012345670001",
@@ -267,7 +283,13 @@
267283
"model": "Lisa",
268284
"model_id": "158-01",
269285
"name": "Thermostaat JM",
270-
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
286+
"preset_modes": [
287+
"no_frost",
288+
"vacation",
289+
"away",
290+
"home",
291+
"asleep"
292+
],
271293
"select_schedule": "off",
272294
"sensors": {
273295
"setpoint": 18.0,
@@ -406,7 +428,13 @@
406428
"model": "Lisa",
407429
"model_id": "158-01",
408430
"name": "Thermostaat SQ",
409-
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
431+
"preset_modes": [
432+
"no_frost",
433+
"vacation",
434+
"away",
435+
"home",
436+
"asleep"
437+
],
410438
"select_schedule": "off",
411439
"sensors": {
412440
"setpoint": 18.5,
@@ -445,7 +473,13 @@
445473
"model": "Lisa",
446474
"model_id": "158-01",
447475
"name": "Thermostaat RB",
448-
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
476+
"preset_modes": [
477+
"no_frost",
478+
"vacation",
479+
"away",
480+
"home",
481+
"asleep"
482+
],
449483
"select_schedule": "off",
450484
"sensors": {
451485
"setpoint": 17.0,
@@ -481,7 +515,13 @@
481515
"model": "ThermoTouch",
482516
"model_id": "143.1",
483517
"name": "Thermostaat WK",
484-
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
518+
"preset_modes": [
519+
"no_frost",
520+
"vacation",
521+
"away",
522+
"home",
523+
"asleep"
524+
],
485525
"select_schedule": "Werkdag schema",
486526
"sensors": {
487527
"setpoint": 21.5,
@@ -513,7 +553,13 @@
513553
"model": "Lisa",
514554
"model_id": "158-01",
515555
"name": "Thermostaat SJ",
516-
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
556+
"preset_modes": [
557+
"no_frost",
558+
"vacation",
559+
"away",
560+
"home",
561+
"asleep"
562+
],
517563
"select_schedule": "off",
518564
"sensors": {
519565
"setpoint": 20.5,
@@ -555,7 +601,13 @@
555601
"model": "Lisa",
556602
"model_id": "158-01",
557603
"name": "Thermostaat KK",
558-
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
604+
"preset_modes": [
605+
"no_frost",
606+
"vacation",
607+
"away",
608+
"home",
609+
"asleep"
610+
],
559611
"select_schedule": "Werkdag schema",
560612
"sensors": {
561613
"battery": 53,
@@ -595,7 +647,13 @@
595647
"model": "Lisa",
596648
"model_id": "158-01",
597649
"name": "Thermostaat BK1",
598-
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
650+
"preset_modes": [
651+
"no_frost",
652+
"vacation",
653+
"away",
654+
"home",
655+
"asleep"
656+
],
599657
"select_schedule": "Werkdag schema",
600658
"sensors": {
601659
"setpoint": 20.5,
@@ -634,7 +692,13 @@
634692
"model": "Lisa",
635693
"model_id": "158-01",
636694
"name": "Thermostaat BK2",
637-
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
695+
"preset_modes": [
696+
"no_frost",
697+
"vacation",
698+
"away",
699+
"home",
700+
"asleep"
701+
],
638702
"select_schedule": "Werkdag schema",
639703
"sensors": {
640704
"setpoint": 20.5,

fixtures/adam_jip/all_data.json

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
"model": "Lisa",
1616
"model_id": "158-01",
1717
"name": "Slaapkamer",
18-
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
18+
"preset_modes": [
19+
"home",
20+
"asleep",
21+
"away",
22+
"vacation",
23+
"no_frost"
24+
],
1925
"sensors": {
2026
"battery": 92,
2127
"setpoint": 13.0,
@@ -116,7 +122,13 @@
116122
"model": "Lisa",
117123
"model_id": "158-01",
118124
"name": "Kinderkamer",
119-
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
125+
"preset_modes": [
126+
"home",
127+
"asleep",
128+
"away",
129+
"vacation",
130+
"no_frost"
131+
],
120132
"sensors": {
121133
"battery": 79,
122134
"setpoint": 13.0,
@@ -176,7 +188,13 @@
176188
"model": "Lisa",
177189
"model_id": "158-01",
178190
"name": "Logeerkamer",
179-
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
191+
"preset_modes": [
192+
"home",
193+
"asleep",
194+
"away",
195+
"vacation",
196+
"no_frost"
197+
],
180198
"sensors": {
181199
"battery": 80,
182200
"setpoint": 13.0,
@@ -203,14 +221,23 @@
203221
},
204222
"dev_class": "gateway",
205223
"firmware": "3.2.8",
206-
"gateway_modes": ["away", "full", "vacation"],
224+
"gateway_modes": [
225+
"away",
226+
"full",
227+
"vacation"
228+
],
207229
"hardware": "AME Smile 2.0 board",
208230
"location": "9e4433a9d69f40b3aefd15e74395eaec",
209231
"mac_address": "012345670001",
210232
"model": "Gateway",
211233
"model_id": "smile_open_therm",
212234
"name": "Adam",
213-
"regulation_modes": ["heating", "off", "bleeding_cold", "bleeding_hot"],
235+
"regulation_modes": [
236+
"heating",
237+
"off",
238+
"bleeding_cold",
239+
"bleeding_hot"
240+
],
214241
"select_gateway_mode": "full",
215242
"select_regulation_mode": "heating",
216243
"sensors": {
@@ -294,7 +321,13 @@
294321
"model": "Jip",
295322
"model_id": "168-01",
296323
"name": "Woonkamer",
297-
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
324+
"preset_modes": [
325+
"home",
326+
"asleep",
327+
"away",
328+
"vacation",
329+
"no_frost"
330+
],
298331
"sensors": {
299332
"battery": 100,
300333
"humidity": 56.2,

fixtures/adam_multiple_devices_per_zone/all_data.json

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,13 @@
134134
"model": "Lisa",
135135
"model_id": "158-01",
136136
"name": "Zone Thermostat Jessie",
137-
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
137+
"preset_modes": [
138+
"home",
139+
"asleep",
140+
"away",
141+
"vacation",
142+
"no_frost"
143+
],
138144
"select_schedule": "CV Jessie",
139145
"sensors": {
140146
"battery": 37,
@@ -285,7 +291,13 @@
285291
"model": "Lisa",
286292
"model_id": "158-01",
287293
"name": "Zone Lisa WK",
288-
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
294+
"preset_modes": [
295+
"home",
296+
"asleep",
297+
"away",
298+
"vacation",
299+
"no_frost"
300+
],
289301
"select_schedule": "GF7 Woonkamer",
290302
"sensors": {
291303
"battery": 34,
@@ -378,7 +390,13 @@
378390
"model": "Lisa",
379391
"model_id": "158-01",
380392
"name": "Zone Lisa Bios",
381-
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
393+
"preset_modes": [
394+
"home",
395+
"asleep",
396+
"away",
397+
"vacation",
398+
"no_frost"
399+
],
382400
"select_schedule": "off",
383401
"sensors": {
384402
"battery": 67,
@@ -422,7 +440,13 @@
422440
"model": "Tom/Floor",
423441
"model_id": "106-03",
424442
"name": "CV Kraan Garage",
425-
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
443+
"preset_modes": [
444+
"home",
445+
"asleep",
446+
"away",
447+
"vacation",
448+
"no_frost"
449+
],
426450
"select_schedule": "off",
427451
"sensors": {
428452
"battery": 68,
@@ -468,7 +492,13 @@
468492
"model": "Lisa",
469493
"model_id": "158-01",
470494
"name": "Zone Thermostat Badkamer",
471-
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
495+
"preset_modes": [
496+
"home",
497+
"asleep",
498+
"away",
499+
"vacation",
500+
"no_frost"
501+
],
472502
"select_schedule": "Badkamer Schema",
473503
"sensors": {
474504
"battery": 92,

0 commit comments

Comments
 (0)