diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..34a9a9f --- /dev/null +++ b/.flake8 @@ -0,0 +1,3 @@ +# Autoformatter friendly flake8 config (all formatting rules disabled) +[flake8] +extend-ignore = E1, E2, E3, E501, W1, W2, W3, W5 diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 72b354e..eaf422e 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -5,4 +5,4 @@ USER gitpod RUN pyenv install 3.9.7 &&\ pyenv global 3.9.7 &&\ echo "export PIP_USER=no" >> /home/gitpod/.bashrc &&\ - python -m pip install virtualenv + python -m pip install --no-cache-dir virtualenv==20.14.1 diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 0000000..60ecd1f --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,7 @@ +# Following source doesn't work in most setups +ignored: + - SC1090 + - SC1091 + +/home/vlb/temp/HAcore/custom_vesync/.venv/local/bin +/home/vlb/temp/HAcore/custom_vesync/.venv/bin \ No newline at end of file diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000..b9fb3f3 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,2 @@ +[settings] +profile=black diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..fb94039 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,10 @@ +# Autoformatter friendly markdownlint config (all formatting rules disabled) +default: true +blank_lines: false +bullet: false +html: false +indentation: false +line_length: false +spaces: false +url: false +whitespace: false diff --git a/.trunk/.gitignore b/.trunk/.gitignore new file mode 100644 index 0000000..7feb17f --- /dev/null +++ b/.trunk/.gitignore @@ -0,0 +1 @@ +*out diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml new file mode 100644 index 0000000..f6088cb --- /dev/null +++ b/.trunk/trunk.yaml @@ -0,0 +1,15 @@ +version: 0.1 +cli: + version: 0.11.0-beta +lint: + enabled: + - actionlint@1.6.9 + - black@22.3.0 + - flake8@4.0.1 + - gitleaks@8.3.0 + - hadolint@2.8.0 + - isort@5.9.3 + - markdownlint@0.31.1 + - prettier@2.5.1 + - taplo-fmt@release-cli-0.6.0 + - taplo@release-cli-0.6.0 diff --git a/custom_components/vesync/config_flow.py b/custom_components/vesync/config_flow.py index b697e93..6fb299c 100644 --- a/custom_components/vesync/config_flow.py +++ b/custom_components/vesync/config_flow.py @@ -1,9 +1,8 @@ """Config flow utilities.""" -from collections import OrderedDict import logging +from collections import OrderedDict import voluptuous as vol - from homeassistant import config_entries from homeassistant.components import dhcp from homeassistant.const import CONF_PASSWORD, CONF_USERNAME diff --git a/custom_components/vesync/pyvesync/vesync.py b/custom_components/vesync/pyvesync/vesync.py index a3b058f..0b6f814 100755 --- a/custom_components/vesync/pyvesync/vesync.py +++ b/custom_components/vesync/pyvesync/vesync.py @@ -1,17 +1,15 @@ """VeSync API Device Library.""" -from itertools import chain import logging import re import time +from itertools import chain from typing import Tuple -from . import ( - vesyncbulb as bulb_mods, - vesyncfan as fan_mods, - vesyncoutlet as outlet_mods, - vesyncswitch as switch_mods, -) +from . import vesyncbulb as bulb_mods +from . import vesyncfan as fan_mods +from . import vesyncoutlet as outlet_mods +from . import vesyncswitch as switch_mods from .helpers import Helpers from .vesyncbasedevice import VeSyncBaseDevice diff --git a/custom_components/vesync/pyvesync/vesyncbulb.py b/custom_components/vesync/pyvesync/vesyncbulb.py index d9315a7..d5f3459 100644 --- a/custom_components/vesync/pyvesync/vesyncbulb.py +++ b/custom_components/vesync/pyvesync/vesyncbulb.py @@ -1,8 +1,8 @@ """Etekcity Smart Light Bulb.""" -from abc import ABCMeta, abstractmethod import json import logging +from abc import ABCMeta, abstractmethod from typing import Dict, Union from .helpers import Helpers as helpers diff --git a/custom_components/vesync/pyvesync/vesyncoutlet.py b/custom_components/vesync/pyvesync/vesyncoutlet.py index 99f6645..d9f45f8 100644 --- a/custom_components/vesync/pyvesync/vesyncoutlet.py +++ b/custom_components/vesync/pyvesync/vesyncoutlet.py @@ -1,9 +1,9 @@ """Etekcity Outlets.""" -from abc import ABCMeta, abstractmethod import json import logging import time +from abc import ABCMeta, abstractmethod from .helpers import Helpers from .vesyncbasedevice import VeSyncBaseDevice diff --git a/custom_components/vesync/pyvesync/vesyncswitch.py b/custom_components/vesync/pyvesync/vesyncswitch.py index 71c3ad9..5cca257 100644 --- a/custom_components/vesync/pyvesync/vesyncswitch.py +++ b/custom_components/vesync/pyvesync/vesyncswitch.py @@ -1,8 +1,8 @@ """Classes for VeSync Switch Devices.""" -from abc import ABCMeta, abstractmethod import json import logging +from abc import ABCMeta, abstractmethod from typing import Dict, Union from .helpers import Helpers as helpers