Skip to content

Commit b3d52b8

Browse files
authored
Merge pull request #79 from maorcc/githuib-actions
Githuib actions
2 parents 1798cd8 + 6d70b6e commit b3d52b8

File tree

10 files changed

+56
-29
lines changed

10 files changed

+56
-29
lines changed

.github/workflows/action.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: HACS Action
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: "0 0 * * *"
8+
9+
jobs:
10+
hacs:
11+
name: HACS Action
12+
runs-on: "ubuntu-latest"
13+
steps:
14+
- name: HACS Action
15+
uses: "hacs/action@main"
16+
with:
17+
category: "integration"

.pre-commit-config.yaml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
repos:
22
- repo: https://github.com/asottile/pyupgrade
3-
rev: v3.15.0
3+
rev: v3.16.0
44
hooks:
55
- id: pyupgrade
66
args: [--py39-plus]
77
- repo: https://github.com/psf/black
8-
rev: 23.12.1
8+
rev: 24.4.2
99
hooks:
1010
- id: black
1111
args:
1212
- --quiet
1313
files: ^((custom_components)/.+)?[^/]+\.py$
1414
- repo: https://github.com/codespell-project/codespell
15-
rev: v2.2.6
15+
rev: v2.3.0
1616
hooks:
1717
- id: codespell
1818
args:
1919
- --ignore-words-list=hass,alot,datas,dof,dur,ether,farenheit,hist,iff,ines,ist,lightsensor,mut,nd,pres,referer,ser,serie,te,technik,ue,uint,visability,wan,wanna,withing,iam,incomfort
20-
- --skip="./.*,*.csv,*.json"
20+
- --skip="./.*,./*.svg,*.svg,*.csv,*.json"
2121
- --quiet-level=2
2222
exclude_types: [csv, json]
2323
- repo: https://github.com/PyCQA/autoflake
24-
rev: v2.2.1
24+
rev: v2.3.1
2525
hooks:
2626
- id: autoflake
2727
args:
2828
- --in-place
2929
- --remove-all-unused-imports
3030
- repo: https://github.com/PyCQA/flake8
31-
rev: 6.1.0
31+
rev: 7.1.0
3232
hooks:
3333
- id: flake8
3434
additional_dependencies:
35-
- pycodestyle>=2.10.0
36-
- pyflakes>=3.0.1
35+
- pycodestyle
36+
- pyflakes
3737
# - flake8-docstrings==1.6.0
3838
# - pydocstyle==6.2.3
39-
- flake8-comprehensions>=3.10.1
40-
- flake8-noqa>=1.3.0
41-
- mccabe>=0.7.0
39+
- flake8-comprehensions
40+
- flake8-noqa
41+
- mccabe
4242
files: ^(custom_components)/.+\.py$
4343
- repo: https://github.com/PyCQA/bandit
44-
rev: 1.7.6
44+
rev: 1.7.9
4545
hooks:
4646
- id: bandit
4747
args:
@@ -54,7 +54,7 @@ repos:
5454
hooks:
5555
- id: isort
5656
- repo: https://github.com/pre-commit/pre-commit-hooks
57-
rev: v4.5.0
57+
rev: v4.6.0
5858
hooks:
5959
- id: check-json
6060
exclude: (.vscode|.devcontainer)
@@ -63,11 +63,10 @@ repos:
6363
- id: trailing-whitespace
6464
- id: check-added-large-files
6565
- repo: https://github.com/adrienverge/yamllint.git
66-
rev: v1.33.0
66+
rev: v1.35.1
6767
hooks:
6868
- id: yamllint
69-
exclude: (.yamllint)
7069
- repo: https://github.com/pre-commit/mirrors-prettier
71-
rev: v3.0.3
70+
rev: v3.0.0-alpha.4
7271
hooks:
7372
- id: prettier

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.jsonc

.yamllint

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
ignore: |
22
azure-*.yml
3+
.yamllint
4+
action.yml
5+
main.yml
36
rules:
47
braces:
58
level: error

custom_components/citymind_water_meter/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
For more details about this component, please refer to the documentation at
44
https://github.com/maorcc/citymind_water_meter
55
"""
6+
67
import logging
78
import sys
89

custom_components/citymind_water_meter/config_flow.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Config flow to configure."""
2+
23
from __future__ import annotations
34

45
import logging

custom_components/citymind_water_meter/diagnostics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Diagnostics support for Tuya."""
2+
23
from __future__ import annotations
34

45
import logging

custom_components/citymind_water_meter/managers/coordinator.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,14 @@ class Coordinator(DataUpdateCoordinator):
6363
_processors: dict[EntityType, BaseProcessor] | None = None
6464
_is_weekend: bool = False
6565

66-
_data_mapping: dict[
67-
str,
68-
Callable[[IntegrationEntityDescription], dict | None]
69-
| Callable[[IntegrationEntityDescription, str], dict | None],
70-
] | None
66+
_data_mapping: (
67+
dict[
68+
str,
69+
Callable[[IntegrationEntityDescription], dict | None]
70+
| Callable[[IntegrationEntityDescription, str], dict | None],
71+
]
72+
| None
73+
)
7174
_system_status_details: dict | None
7275

7376
_last_update: float
@@ -558,12 +561,14 @@ def _get_alert_setting_data(self, entity_description) -> dict | None:
558561

559562
result = {
560563
ATTR_IS_ON: is_on,
561-
ATTR_ACTIONS: {
562-
ACTION_ENTITY_TURN_ON: self._set_alert_setting_enabled,
563-
ACTION_ENTITY_TURN_OFF: self._set_alert_setting_disabled,
564-
}
565-
if entity_description.key != EntityKeys.ALERT_LEAK_EMAIL
566-
else None,
564+
ATTR_ACTIONS: (
565+
{
566+
ACTION_ENTITY_TURN_ON: self._set_alert_setting_enabled,
567+
ACTION_ENTITY_TURN_OFF: self._set_alert_setting_disabled,
568+
}
569+
if entity_description.key != EntityKeys.ALERT_LEAK_EMAIL
570+
else None
571+
),
567572
}
568573

569574
return result

custom_components/citymind_water_meter/managers/flow_manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Config flow to configure."""
2+
23
from __future__ import annotations
34

45
from copy import copy

hacs.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
22
"name": "City-Mind Water Meter",
3-
"domains": ["sensor"],
43
"country": "IL",
5-
"iot_class": ["Cloud Polling"],
64
"homeassistant": "2024.1.0b0"
75
}

0 commit comments

Comments
 (0)