Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Biome part 2 #621

Merged
merged 13 commits into from
Sep 20, 2024
5 changes: 5 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -157,6 +157,11 @@ jobs:
run: |
. venv/bin/activate
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual pylint
- name: Biome lint
run: |
. venv/bin/activate
mkdir -p ./tmp && curl -sL "https://github.com/biomejs/biome/releases/latest/download/biome-linux-x64" -o ./tmp/biome && chmod +x ./tmp/biome
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual biome
- name: Lint markdown files
run: |
. venv/bin/activate
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -12,8 +12,6 @@ tests/__pycache__
.vscode
venv
*.sedbck
tmp
.mypy_cache
node_modules/
package-lock.json
fixtures/updated/*/
tmp
CoMPaTech marked this conversation as resolved.
Show resolved Hide resolved
20 changes: 13 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ci:
# Defer autoupdate to quarterly (there is no 'off' button) to have renovate pick up first
autoupdate_schedule: quarterly
skip: [pylint, markdownlint, testing]
skip: [setup, setup_test, pylint, markdownlint, testing, biome]
submodules: true

default_language_version:
@@ -67,6 +67,14 @@ repos:
# pyenv and/or virtualenv activated; it may not have been e.g. if
# committing from a GUI tool that was not launched from an activated
# shell.
- id: setup
name: Setup python
entry: /usr/bin/env bash -c 'test -d ./venv || scripts/setup.sh'
language: script
- id: setup_test
name: Setup testing
entry: /usr/bin/env bash -c 'test -f ./tmp/biome || scripts/setup_test.sh pre-commit'
language: script
- id: userdata
name: userdata
entry: scripts/pre-commit.sh
@@ -92,12 +100,10 @@ repos:
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" scripts/tests_and_coverage.sh test_and_coverage'
language: script
pass_filenames: false
- repo: https://github.com/biomejs/pre-commit
rev: v0.4.0
hooks:
- id: biome-lint
additional_dependencies: ["@biomejs/biome@1.8.3"]
name: "Verifying/updating code with biome (improved prettier)"
- id: biome
name: "Local Linting - Biome"
entry: ./tmp/biome lint --staged --files-ignore-unknown=true --no-errors-on-unmatched
language: script
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.41.0
hooks:
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v1.4.1

- Prettying documents with Biome (CLI), fixture layout updated accordingly.

## v1.4.0

- Improve model_id implementation, allow direct access to the gateway `smile_model_id`.
86 changes: 75 additions & 11 deletions fixtures/adam_heatpump_cooling/all_data.json
Original file line number Diff line number Diff line change
@@ -60,7 +60,13 @@
"model": "Lisa",
"model_id": "158-01",
"name": "Thermostaat BK",
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
"preset_modes": [
"no_frost",
"vacation",
"away",
"home",
"asleep"
],
"select_schedule": "off",
"sensors": {
"battery": 55,
@@ -180,7 +186,13 @@
"model": "Lisa",
"model_id": "158-01",
"name": "Thermostaat DB",
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
"preset_modes": [
"no_frost",
"vacation",
"away",
"home",
"asleep"
],
"select_schedule": "off",
"sensors": {
"setpoint": 18.0,
@@ -227,7 +239,11 @@
},
"dev_class": "gateway",
"firmware": "3.2.8",
"gateway_modes": ["away", "full", "vacation"],
"gateway_modes": [
"away",
"full",
"vacation"
],
"hardware": "AME Smile 2.0 board",
"location": "eedadcb297564f1483faa509179aebed",
"mac_address": "012345670001",
@@ -267,7 +283,13 @@
"model": "Lisa",
"model_id": "158-01",
"name": "Thermostaat JM",
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
"preset_modes": [
"no_frost",
"vacation",
"away",
"home",
"asleep"
],
"select_schedule": "off",
"sensors": {
"setpoint": 18.0,
@@ -406,7 +428,13 @@
"model": "Lisa",
"model_id": "158-01",
"name": "Thermostaat SQ",
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
"preset_modes": [
"no_frost",
"vacation",
"away",
"home",
"asleep"
],
"select_schedule": "off",
"sensors": {
"setpoint": 18.5,
@@ -445,7 +473,13 @@
"model": "Lisa",
"model_id": "158-01",
"name": "Thermostaat RB",
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
"preset_modes": [
"no_frost",
"vacation",
"away",
"home",
"asleep"
],
"select_schedule": "off",
"sensors": {
"setpoint": 17.0,
@@ -481,7 +515,13 @@
"model": "ThermoTouch",
"model_id": "143.1",
"name": "Thermostaat WK",
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
"preset_modes": [
"no_frost",
"vacation",
"away",
"home",
"asleep"
],
"select_schedule": "Werkdag schema",
"sensors": {
"setpoint": 21.5,
@@ -513,7 +553,13 @@
"model": "Lisa",
"model_id": "158-01",
"name": "Thermostaat SJ",
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
"preset_modes": [
"no_frost",
"vacation",
"away",
"home",
"asleep"
],
"select_schedule": "off",
"sensors": {
"setpoint": 20.5,
@@ -555,7 +601,13 @@
"model": "Lisa",
"model_id": "158-01",
"name": "Thermostaat KK",
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
"preset_modes": [
"no_frost",
"vacation",
"away",
"home",
"asleep"
],
"select_schedule": "Werkdag schema",
"sensors": {
"battery": 53,
@@ -595,7 +647,13 @@
"model": "Lisa",
"model_id": "158-01",
"name": "Thermostaat BK1",
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
"preset_modes": [
"no_frost",
"vacation",
"away",
"home",
"asleep"
],
"select_schedule": "Werkdag schema",
"sensors": {
"setpoint": 20.5,
@@ -634,7 +692,13 @@
"model": "Lisa",
"model_id": "158-01",
"name": "Thermostaat BK2",
"preset_modes": ["no_frost", "vacation", "away", "home", "asleep"],
"preset_modes": [
"no_frost",
"vacation",
"away",
"home",
"asleep"
],
"select_schedule": "Werkdag schema",
"sensors": {
"setpoint": 20.5,
45 changes: 39 additions & 6 deletions fixtures/adam_jip/all_data.json
Original file line number Diff line number Diff line change
@@ -15,7 +15,13 @@
"model": "Lisa",
"model_id": "158-01",
"name": "Slaapkamer",
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"preset_modes": [
"home",
"asleep",
"away",
"vacation",
"no_frost"
],
"sensors": {
"battery": 92,
"setpoint": 13.0,
@@ -116,7 +122,13 @@
"model": "Lisa",
"model_id": "158-01",
"name": "Kinderkamer",
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"preset_modes": [
"home",
"asleep",
"away",
"vacation",
"no_frost"
],
"sensors": {
"battery": 79,
"setpoint": 13.0,
@@ -176,7 +188,13 @@
"model": "Lisa",
"model_id": "158-01",
"name": "Logeerkamer",
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"preset_modes": [
"home",
"asleep",
"away",
"vacation",
"no_frost"
],
"sensors": {
"battery": 80,
"setpoint": 13.0,
@@ -203,14 +221,23 @@
},
"dev_class": "gateway",
"firmware": "3.2.8",
"gateway_modes": ["away", "full", "vacation"],
"gateway_modes": [
"away",
"full",
"vacation"
],
"hardware": "AME Smile 2.0 board",
"location": "9e4433a9d69f40b3aefd15e74395eaec",
"mac_address": "012345670001",
"model": "Gateway",
"model_id": "smile_open_therm",
"name": "Adam",
"regulation_modes": ["heating", "off", "bleeding_cold", "bleeding_hot"],
"regulation_modes": [
"heating",
"off",
"bleeding_cold",
"bleeding_hot"
],
"select_gateway_mode": "full",
"select_regulation_mode": "heating",
"sensors": {
@@ -294,7 +321,13 @@
"model": "Jip",
"model_id": "168-01",
"name": "Woonkamer",
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"preset_modes": [
"home",
"asleep",
"away",
"vacation",
"no_frost"
],
"sensors": {
"battery": 100,
"humidity": 56.2,
40 changes: 35 additions & 5 deletions fixtures/adam_multiple_devices_per_zone/all_data.json
Original file line number Diff line number Diff line change
@@ -134,7 +134,13 @@
"model": "Lisa",
"model_id": "158-01",
"name": "Zone Thermostat Jessie",
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"preset_modes": [
"home",
"asleep",
"away",
"vacation",
"no_frost"
],
"select_schedule": "CV Jessie",
"sensors": {
"battery": 37,
@@ -285,7 +291,13 @@
"model": "Lisa",
"model_id": "158-01",
"name": "Zone Lisa WK",
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"preset_modes": [
"home",
"asleep",
"away",
"vacation",
"no_frost"
],
"select_schedule": "GF7 Woonkamer",
"sensors": {
"battery": 34,
@@ -378,7 +390,13 @@
"model": "Lisa",
"model_id": "158-01",
"name": "Zone Lisa Bios",
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"preset_modes": [
"home",
"asleep",
"away",
"vacation",
"no_frost"
],
"select_schedule": "off",
"sensors": {
"battery": 67,
@@ -422,7 +440,13 @@
"model": "Tom/Floor",
"model_id": "106-03",
"name": "CV Kraan Garage",
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"preset_modes": [
"home",
"asleep",
"away",
"vacation",
"no_frost"
],
"select_schedule": "off",
"sensors": {
"battery": 68,
@@ -468,7 +492,13 @@
"model": "Lisa",
"model_id": "158-01",
"name": "Zone Thermostat Badkamer",
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"preset_modes": [
"home",
"asleep",
"away",
"vacation",
"no_frost"
],
"select_schedule": "Badkamer Schema",
"sensors": {
"battery": 92,
Loading