Skip to content

Commit faf35fa

Browse files
committed
chore: extend precommit with more hooks
1 parent 432b23e commit faf35fa

26 files changed

Lines changed: 62 additions & 27 deletions

File tree

.pre-commit-config.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,31 @@ repos:
4444
types: [python]
4545
require_serial: true
4646
files: ^custom_components/powercalc
47+
- id: ty
48+
name: ty
49+
entry: uv run ty check custom_components/powercalc
50+
language: system
51+
pass_filenames: false
52+
stages: [ manual ]
53+
files: ^custom_components/powercalc/.*\.py$
54+
- id: uv-lock
55+
name: uv lock --check
56+
entry: uv lock --check
57+
language: system
58+
pass_filenames: false
59+
files: ^(pyproject\.toml|uv\.lock)$
60+
- id: uv-lock-measure
61+
name: uv lock --check (utils/measure)
62+
entry: uv --directory utils/measure lock --check
63+
language: system
64+
pass_filenames: false
65+
files: ^utils/measure/(pyproject\.toml|uv\.lock)$
66+
- id: uv-lock-visualize
67+
name: uv lock --check (utils/visualize)
68+
entry: uv --directory utils/visualize lock --check
69+
language: system
70+
pass_filenames: false
71+
files: ^utils/visualize/(pyproject\.toml|uv\.lock)$
4772

4873
- repo: https://github.com/codespell-project/codespell
4974
rev: v2.4.1
@@ -55,6 +80,10 @@ repos:
5580
hooks:
5681
- id: check-github-workflows
5782
args: [ "--verbose" ]
83+
- id: check-jsonschema
84+
name: validate power profile model.json
85+
args: [--schemafile, profile_library/model_schema.json]
86+
files: ^profile_library/[^/]+/[^/]+/model\.json$
5887

5988
- repo: https://github.com/rhysd/actionlint
6089
rev: v1.7.10
@@ -66,3 +95,9 @@ repos:
6695
hooks:
6796
- id: zizmor
6897
args: [--no-progress, --fix]
98+
99+
- repo: https://github.com/shellcheck-py/shellcheck-py
100+
rev: v0.11.0.1
101+
hooks:
102+
- id: shellcheck
103+
files: \.sh$

profile_library/bosch/Smart Home Controller 1 Gen/model.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
],
66
"author": "Justin Hahn <justin.hahn@live.com>",
77
"calculation_strategy": "fixed",
8-
"created_at": "2025-04-10T00:41:25+01:00",
8+
"created_at": "2025-04-09T23:41:25Z",
99
"description": "The measured Bosch Smart Home Controller had the following devices connected: four Bosch Smart Home Radiator Thermostat II (TRV_GEN2), two Bosch Smart Home Radiator Thermostat I (TRV), and two Bosch Smart Home Door/Window Contact II (SWD2).During the 120-second measurement period, the temperature was adjusted both directly on the device itself and via the Smart Home Controller on one TRV thermostat and on one TRV_GEN2 thermostat. In addition, both window sensors were triggered twice each by opening and closing the windows.",
1010
"device_type": "generic_iot",
1111
"discovery_by": "device",

profile_library/dreo/DR-HAF001S/model.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "miggi92 <miggi92@users.noreply.github.com>",
33
"calculation_strategy": "linear",
4-
"created_at": "2025-07-14T09:52:08+02:00",
4+
"created_at": "2025-07-14T07:52:08Z",
55
"device_type": "fan",
66
"linear_config": {
77
"attribute": "percentage",

profile_library/dreo/DR-HTF001S/model.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "miggi92 <miggi92@users.noreply.github.com>",
33
"calculation_strategy": "linear",
4-
"created_at": "2025-07-14T10:15:08+02:00",
4+
"created_at": "2025-07-14T08:15:08Z",
55
"device_type": "fan",
66
"linear_config": {
77
"attribute": "percentage",

profile_library/dreo/DR-HTF002S/model.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "miggi92 <miggi92@users.noreply.github.com>",
33
"calculation_strategy": "linear",
4-
"created_at": "2025-07-14T10:10:08+02:00",
4+
"created_at": "2025-07-14T08:10:08Z",
55
"device_type": "fan",
66
"linear_config": {
77
"attribute": "percentage",

profile_library/shelly/Shelly 1 Gen3/model.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"calculation_strategy": "fixed",
1717
"only_self_usage": false,
1818
"config_flow_sub_profile_remarks": "Select a profile depending on your Shelly device configuration.",
19-
"created_at": "2026-01-15T11:15:00+01:00",
19+
"created_at": "2026-01-15T10:15:00Z",
2020
"author": "Michal Bartak <maxym.srpl@gmail.com>",
2121
"author_info": {
2222
"name": "Michal Bartak",

profile_library/shelly/Shelly 1/model.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
],
55
"author": "Michal Bartak <maxym.srpl@gmail.com>",
66
"calculation_strategy": "fixed",
7-
"created_at": "2024-01-05T13:55:00+01:00",
7+
"created_at": "2024-01-05T12:55:00Z",
88
"device_type": "smart_switch",
99
"discovery_by": "entity",
1010
"measure_description": "The measured device fw: 1.14.1-rc1, Eco Mode enabled, Wifi Client enabled. The result represents the average value of measurements collected from the measurement device API for the following scenarios: dumb device/baseline consumption (~4.9W), the the relay turned off, and the relay turned on.",

profile_library/shelly/Shelly 1L Gen3/model.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"author": "Victor Burlacu-Zane",
66
"calculation_strategy": "fixed",
77
"config_flow_sub_profile_remarks": "You need to select a profile depending on your settings.\nThe ECO setting only changes the power consumption in the listed configurations. Activating any other settings not listed in the profile name will change the power draw.\n\"WLAN + BT + ECO\": All three turned on, repeater turned off.\n\"WLAN + ECO\": Both turned on, repeater turned off.\n\"WLAN + BT\": Both turned on, repeater turned on, ECO turned off.\n\"WLAN\": Only WLAN turned on, all others off.\n\"Other combinations\": For all other combinations. Maximum device power draw.",
8-
"created_at": "2026-01-05T20:06:00+01:00",
8+
"created_at": "2026-01-05T19:06:00Z",
99
"device_type": "smart_switch",
1010
"discovery_by": "entity",
1111
"measure_description": "Measured with disconnected load, for about 90 minutes and calculated average from values stored by Home Assistant. Multiple combinations of settings were tested. Firmware version 1.7.1 for the tested Shelly 1L Gen3 device. The power values are long-term averages measured while the device periodically wakes to maintain connectivity. Instantaneous power is higher during wakeups when the relay is off, but the average energy consumption is accurately reflected.",

profile_library/shelly/Shelly 1PM Mini Gen4/model.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"author": "Michal Bartak <maxym.srpl@gmail.com>",
77
"calculation_strategy": "fixed",
88
"config_flow_sub_profile_remarks": "You need to select a profile depending on your Shelly configuration.\nIf not sure, select 'Other combinations' which will report the highest possible draw.",
9-
"created_at": "2025-11-29T10:48:00+01:00",
9+
"created_at": "2025-11-29T09:48:00Z",
1010
"device_type": "smart_switch",
1111
"measure_description": "The measured device fw: 1.7.1. The result represents the average value of measurements collected from the measuring device API for the following scenarios: dumb device/baseline consumption (~3.8W) and several device configurations. See sub-profiles.",
1212
"measure_device": "Shelly PM Mini Gen3",

profile_library/shelly/Shelly 1PM/model.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
],
55
"author": "Michal Bartak <maxym.srpl@gmail.com>",
66
"calculation_strategy": "fixed",
7-
"created_at": "2024-01-09T20:21:00+01:00",
7+
"created_at": "2024-01-09T19:21:00Z",
88
"device_type": "smart_switch",
99
"discovery_by": "entity",
1010
"measure_description": "The measured device fw: 1.14.1-rc1, Eco Mode enabled, Wifi Client enabled, LED disabled. The result represents the average value of measurements collected from the measurement device API for the following scenarios: dumb device/baseline consumption (~4.9W), the the relay turned off, and the relay turned on.",

0 commit comments

Comments
 (0)