Skip to content

Commit

Permalink
Merge pull request #79 from maorcc/githuib-actions
Browse files Browse the repository at this point in the history
Githuib actions
  • Loading branch information
elad-bar authored Jul 7, 2024
2 parents 1798cd8 + 6d70b6e commit b3d52b8
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 29 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: HACS Action

on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"

jobs:
hacs:
name: HACS Action
runs-on: "ubuntu-latest"
steps:
- name: HACS Action
uses: "hacs/action@main"
with:
category: "integration"
31 changes: 15 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.16.0
hooks:
- id: pyupgrade
args: [--py39-plus]
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.4.2
hooks:
- id: black
args:
- --quiet
files: ^((custom_components)/.+)?[^/]+\.py$
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
args:
- --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
- --skip="./.*,*.csv,*.json"
- --skip="./.*,./*.svg,*.svg,*.csv,*.json"
- --quiet-level=2
exclude_types: [csv, json]
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.1
rev: v2.3.1
hooks:
- id: autoflake
args:
- --in-place
- --remove-all-unused-imports
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.1.0
hooks:
- id: flake8
additional_dependencies:
- pycodestyle>=2.10.0
- pyflakes>=3.0.1
- pycodestyle
- pyflakes
# - flake8-docstrings==1.6.0
# - pydocstyle==6.2.3
- flake8-comprehensions>=3.10.1
- flake8-noqa>=1.3.0
- mccabe>=0.7.0
- flake8-comprehensions
- flake8-noqa
- mccabe
files: ^(custom_components)/.+\.py$
- repo: https://github.com/PyCQA/bandit
rev: 1.7.6
rev: 1.7.9
hooks:
- id: bandit
args:
Expand All @@ -54,7 +54,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-json
exclude: (.vscode|.devcontainer)
Expand All @@ -63,11 +63,10 @@ repos:
- id: trailing-whitespace
- id: check-added-large-files
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.33.0
rev: v1.35.1
hooks:
- id: yamllint
exclude: (.yamllint)
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v3.0.0-alpha.4
hooks:
- id: prettier
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.jsonc
3 changes: 3 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
ignore: |
azure-*.yml
.yamllint
action.yml
main.yml
rules:
braces:
level: error
Expand Down
1 change: 1 addition & 0 deletions custom_components/citymind_water_meter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
For more details about this component, please refer to the documentation at
https://github.com/maorcc/citymind_water_meter
"""

import logging
import sys

Expand Down
1 change: 1 addition & 0 deletions custom_components/citymind_water_meter/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Config flow to configure."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions custom_components/citymind_water_meter/diagnostics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Diagnostics support for Tuya."""

from __future__ import annotations

import logging
Expand Down
27 changes: 16 additions & 11 deletions custom_components/citymind_water_meter/managers/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,14 @@ class Coordinator(DataUpdateCoordinator):
_processors: dict[EntityType, BaseProcessor] | None = None
_is_weekend: bool = False

_data_mapping: dict[
str,
Callable[[IntegrationEntityDescription], dict | None]
| Callable[[IntegrationEntityDescription, str], dict | None],
] | None
_data_mapping: (
dict[
str,
Callable[[IntegrationEntityDescription], dict | None]
| Callable[[IntegrationEntityDescription, str], dict | None],
]
| None
)
_system_status_details: dict | None

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

result = {
ATTR_IS_ON: is_on,
ATTR_ACTIONS: {
ACTION_ENTITY_TURN_ON: self._set_alert_setting_enabled,
ACTION_ENTITY_TURN_OFF: self._set_alert_setting_disabled,
}
if entity_description.key != EntityKeys.ALERT_LEAK_EMAIL
else None,
ATTR_ACTIONS: (
{
ACTION_ENTITY_TURN_ON: self._set_alert_setting_enabled,
ACTION_ENTITY_TURN_OFF: self._set_alert_setting_disabled,
}
if entity_description.key != EntityKeys.ALERT_LEAK_EMAIL
else None
),
}

return result
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Config flow to configure."""

from __future__ import annotations

from copy import copy
Expand Down
2 changes: 0 additions & 2 deletions hacs.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"name": "City-Mind Water Meter",
"domains": ["sensor"],
"country": "IL",
"iot_class": ["Cloud Polling"],
"homeassistant": "2024.1.0b0"
}

0 comments on commit b3d52b8

Please sign in to comment.