Skip to content

Commit cbbc2ce

Browse files
authored
Merge pull request #273 from plugwise/improve
Textual improvements and addition of codeowners
2 parents 5f68cfc + 8ec3e03 commit cbbc2ce

File tree

10 files changed

+272
-159
lines changed

10 files changed

+272
-159
lines changed

.github/workflows/verify.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: Latest commit
55

66
env:
7-
CACHE_VERSION: 3
7+
CACHE_VERSION: 4
88
DEFAULT_PYTHON: "3.10"
99
PRE_COMMIT_HOME: ~/.cache/pre-commit
1010

@@ -153,6 +153,10 @@ jobs:
153153
run: |
154154
. venv/bin/activate
155155
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual pylint
156+
- name: Lint markdown files
157+
run: |
158+
. venv/bin/activate
159+
pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual markdownlint
156160
157161
prepare-test-cache:
158162
runs-on: ubuntu-latest

.markdownlint.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
default: true
2+
MD013: false

.pre-commit-config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ci:
2-
skip: [pylint]
2+
skip: [pylint, markdownlint]
33
submodules: true
44

55
default_language_version:
@@ -111,3 +111,7 @@ repos:
111111
language: script
112112
types: [python]
113113
files: ^plugwise/.+\.py$
114+
- repo: https://github.com/igorshubovych/markdownlint-cli
115+
rev: v0.33.0
116+
hooks:
117+
- id: markdownlint

CHANGELOG.md

Lines changed: 145 additions & 85 deletions
Large diffs are not rendered by default.

CODEOWNERS

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Plugwise CodeOwners
2+
# Order is important. The last matching pattern has the most precedence.
3+
4+
# Specific files
5+
setup.cfg @plugwise/devs
6+
setup.py @plugwise/devs
7+
pyproject.toml @plugwise/devs
8+
requirements*.txt @plugwise/devs
9+
10+
# Main code
11+
/plugwise/ @plugwise/devs
12+
/userdata/ @plugwise/devs
13+
14+
# Tests and development support
15+
/tests/ @bouwew @compatech
16+
/scripts/ @bouwew @compatech
17+
18+
# NET specific
19+
/plugwise/smile.py @bouwew @compatech
20+
21+
# USB specific
22+
/plugwise/connections/ @brefra
23+
/plugwise/controller.py @bouwew @brefra
24+
/plugwise/messages/ @brefra
25+
/plugwise/nodes/ @brefra
26+
/plugwise/parser.py @brefra
27+
/plugwise/stick.py @brefra
28+
/plugwise/util.py @brefra
29+

README.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
# Plugwise python module
22

3-
This module is the backend for the [`plugwise` component](https://github.com/home-assistant/core/tree/dev/homeassistant/components/plugwise) which we maintain in Home Assistant Core.
3+
This module is the backend for the [`plugwise` component](https://github.com/home-assistant/core/tree/dev/homeassistant/components/plugwise) which we maintain as co-code owners Home Assistant Core.
44

55
Our main usage for this module is supporting [Home Assistant](https://www.home-assistant.io) / [home-assistant](http://github.com/home-assistant/core/)
66

77
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/plugwise)
8-
[![CodeFactor](https://www.codefactor.io/repository/github/plugwise/python-plugwise/badge)](https://www.codefactor.io/repository/github/plugwise/python-plugwise)
9-
[![Latest release](https://github.com/plugwise/python-plugwise/workflows/Latest%20release/badge.svg)](https://github.com/plugwise/python-plugwise/actions)
10-
[![codecov](https://codecov.io/gh/plugwise/python-plugwise/branch/main/graph/badge.svg)](https://codecov.io/gh/plugwise/python-plugwise)
118
[![PyPI version fury.io](https://badge.fury.io/py/plugwise.svg)](https://pypi.python.org/pypi/plugwise/)
9+
10+
[![Latest release](https://github.com/plugwise/python-plugwise/workflows/Latest%20release/badge.svg)](https://github.com/plugwise/python-plugwise/actions)
1211
[![Newest commit](https://github.com/plugwise/python-plugwise/workflows/Latest%20commit/badge.svg)](https://github.com/plugwise/python-plugwise/actions)
1312
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/plugwise/python-plugwise/main.svg)](https://results.pre-commit.ci/latest/github/plugwise/python-plugwise/main)
1413

14+
[![CodeFactor](https://www.codefactor.io/repository/github/plugwise/python-plugwise/badge)](https://www.codefactor.io/repository/github/plugwise/python-plugwise)
15+
[![codecov](https://codecov.io/gh/plugwise/python-plugwise/branch/main/graph/badge.svg)](https://codecov.io/gh/plugwise/python-plugwise)
16+
1517
## Integration
1618

1719
### Home-Assistant Integration
@@ -20,23 +22,27 @@ Our main usage for this module is supporting [Home Assistant](https://www.home-a
2022

2123
[![Generic badge](https://img.shields.io/badge/HA%20core-yes-green.svg)](https://github.com/home-assistant/core/tree/dev/homeassistant/components/plugwise)
2224

23-
Works out of the box with every Home Assistant installation
25+
Works out of the box with every Home Assistant installation, use the button below to install
26+
27+
[![Open your Home Assistant instance and show your integrations.](https://my.home-assistant.io/badges/integrations.svg)](https://my.home-assistant.io/redirect/integrations/)
2428

2529
### Home-Assistant custom_component (beta)
2630

27-
Intended for users helping us test new features (use at your own risk)
31+
We do (also) maintain a `custom_component`, please note this is **only** intended for users helping us test new features (use at your own risk)
2832

2933
[![Generic badge](https://img.shields.io/github/v/release/plugwise/plugwise-beta)](https://github.com/plugwise/plugwise-beta)
30-
[![Generic badge](https://img.shields.io/badge/HA%20custom_component-yes-green.svg)](https://github.com/plugwise/plugwise-beta)
34+
35+
You can add our `custom_component` repository to HACS, do note that we do not intent for our `beta` `custom_component` to be included in the HACS repository.
36+
3137
[![Generic badge](https://img.shields.io/badge/HACS-add%20our%20repo-yellow.svg)](https://github.com/plugwise/plugwise-beta)
3238

33-
See the [`plugwise-beta`](https://github.com/plugwise/plugwise-beta) repository for more info. Requires additional configuration/handling to get your integration running.
39+
See the [`plugwise-beta`](https://github.com/plugwise/plugwise-beta) repository for more info.
3440

3541
## Development/patches
3642

37-
Like Home Assistant Core we use `pre-commit` to validate your commits and eventually PRs.
43+
Like Home Assistant Core we use `pre-commit` and additionally run [pre-commit.ci](http://pre-commit.ci) to automatically validate your commits and PRs.
3844

39-
Please make sure you at least ran `scripts/setup.sh` before attempting to `git commit`. But we sincerely recommended to also use local testing, see `tests/README.md` for more information.
45+
If you want to create a PR please make sure you at least run `scripts/setup.sh`. This will ensure your environment is set up correctly before attempting to `git commit`. We sincerely and highly recommended also setting up local testing, see [`tests/README.md`](https://github.com/plugwise/python-plugwise/blob/main/tests/README.md) for more information and run `scripts/setup_test.sh` to prepare your environment.
4046

4147
## Project support status
4248

@@ -76,8 +82,8 @@ Origins (from newest to oldest):
7682
- Networked Plugwise Anna module with custom_module - `haanna/anna-ha` via <https://github.com/laetificat> (Kevin)
7783
- USB-based stick module with custom_module - `plugwise-stick/plugwise` by @brefra (Frank)
7884
- USB-plugwise module - `plugwise` by <https://github.com/cyberjunky/python-plugwise> (Ron) originally by <https://github.com/aequitas/python-plugwise> (Johan) (with reference only in license to Sven)
79-
- Sensor for Plugwise Smile P1 integration - `home-assistant-sensor-plugwise-smile-p1` by <https://bitbucket.org/jvdschoot/home-assistant-sensor-plugwise-smile-p1> (Jeroen van der Schoot)
85+
- Sensor for Plugwise Smile P1 integration - `home-assistant-sensor-plugwise-smile-p1` by <https://bitbucket.org/jvdschoot/home-assistant-sensor-plugwise-smile-p1> (Jeroen van der Schoot)
8086

8187
## Thanks
8288

83-
On behalf all of us, big thanks to Plugwise and community members @riemers and @tane from [HAshop](https://hashop.nl)for their support and obviously all our users and testers who dealt with our typos and challenges. Disclaimer, while we are communicating with Plugwise and they expressed their gratitude through their newsletter, we are not part of Plugwise as a company. We are just a bunch of guys anxious to get our (and your) Plugwise products working with Home Assistant.
89+
On behalf all of us, big thanks to Plugwise and community members @riemers and @tane from [HAshop](https://hashop.nl) for their support and obviously all our users and testers who dealt with our typos and challenges. Disclaimer, while we are communicating with Plugwise and they expressed their gratitude through their newsletter, we are not part of Plugwise as a company. We are just a bunch of guys anxious to get our (and your) Plugwise products working with Home Assistant.

tests/INIT.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,35 @@
44

55
Needed:
66

7-
- [ ] Github account (or organisation and account(s))
8-
- [ ] Codecov account (just choose 'login with github')
9-
- [ ] CodeFactor account (again, login with github)
10-
- [ ] Add codecov as an integration from Github's integrations (basically 'buy' it, except its at no cost)
7+
- [ ] Github account (or organisation and account(s))
8+
- [ ] Codecov account (just choose 'login with github')
9+
- [ ] CodeFactor account (again, login with github)
10+
- [ ] Add codecov as an integration from Github's integrations (basically 'buy' it, except its at no cost)
1111

1212
## Configuration
1313

1414
After the initial setup of the repo/initial commit, walk the repo-settings on GitHub using your browser.
1515

16-
- [ ] [Set the product image, turn off wiki and automatically delete branches (from defaults)](https://github.com/plugwise/python-plugwise/settings)
17-
- [ ] [Activate both dependabots and keep dependency graph open](https://github.com/plugwise/python-plugwise/settings/security_analysis)
18-
- [ ] [Integrations, configure codecov (should show up from organisation)](https://github.com/plugwise/python-plugwise/settings/installations)
16+
- [ ] [Set the product image, turn off wiki and automatically delete branches (from defaults)](https://github.com/plugwise/python-plugwise/settings)
17+
- [ ] [Activate both dependabots and keep dependency graph open](https://github.com/plugwise/python-plugwise/settings/security_analysis)
18+
- [ ] [Integrations, configure codecov (should show up from organisation)](https://github.com/plugwise/python-plugwise/settings/installations)
1919

2020
For this step you might need to follow [this publishing guide](https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/) taking you through most of the steps. Note that the projects on PyPi already [**need to exist**](https://packaging.python.org/tutorials/packaging-projects/) so use a generic token first and later adjust that to only this project (as explained on that howto):
2121

22-
- [ ] [Configure secrets for PYPI_TOKEN and TESTPYPI_TOKEN](https://github.com/plugwise/Plugwise-Smile/settings/secrets)
22+
- [ ] [Configure secrets for PYPI_TOKEN and TESTPYPI_TOKEN](https://github.com/plugwise/Plugwise-Smile/settings/secrets)
2323

2424
## Initializing pypi
2525

26-
Once the project is ready for upload to test (i.e. version number ending in `a0` or something likewise): upload it manually using `twine upload`:
26+
Once the project is ready for upload to test (i.e. version number ending in `a0` or something likewise): upload it manually using `twine upload`:
2727

2828
Prepare:
2929

30-
- [ ] `python3 -m venv venv ; source venv/bin/activate ; pip install --upgrade pip; pip install -r requirements_test.txt ; pip install --upgrade setuptools wheel twine`
30+
- [ ] `python3 -m venv venv ; source venv/bin/activate ; pip install --upgrade pip; pip install -r requirements_test.txt ; pip install --upgrade setuptools wheel twine`
3131

32-
Package: (** ensure you are in your venv**)
32+
Package: (**ensure you are in your venv**)
3333

34-
- [ ] [pypi packaging](https://packaging.python.org/tutorials/packaging-projects/)
35-
- [ ] `python3 setup.py sdist bdist_wheel`
34+
- [ ] [pypi packaging](https://packaging.python.org/tutorials/packaging-projects/)
35+
- [ ] `python3 setup.py sdist bdist_wheel`
3636

3737
Then reconfigure your tokens on the pypi website accordingly (only allowing project updates) and carry on.
3838

@@ -65,6 +65,4 @@ From [integrations](https://github.com/plugwise/python-plugwise/settings/install
6565

6666
If you push templates within the `.github/ISSUE_TEMPLATES` directory they should be available, if not:
6767

68-
- [ ] Go to [issue templates](https://github.com/plugwise/python-plugwise/issues/templates/edit) and create them
69-
70-
68+
- [ ] Go to [issue templates](https://github.com/plugwise/python-plugwise/issues/templates/edit) and create them

tests/README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
11
# Testing (for developers)
22

3-
Plugwise-Smile has to be in working and functioning condition on all circumstances. Hence testing.
3+
Plugwise-Smile has to be in working and functioning condition on all circumstances. Hence testing is applied and tested through [Github Actions](https://github.com/plugwise/python-plugwise/actions).
44

55
## Tests
6+
67
From the above list of setups a number of values is selected to be asserted. Currently we have the following asserts in place:
78

89
Information gathering: (negative)
10+
911
- Check handling against a Smile that 'times out' during request
1012
- Check handling against a Smile refusing contact (`internal server error`)
1113

1214
Service handling (i.e. changing setpoint or switching a relay)
15+
1316
- Check against a Smile not accepting change (`internal server error`) (negative)
1417
- Switch a relay, change a setpoint or change a schema/preset (positive)
1518

1619
Data processing (positive)
20+
1721
- Includes checking various `measures` and settings for each device / location / combination of both
1822

1923
## Running tests against Plugwise Smile
2024

21-
Our tests are mainly conducted locally by the contributors and using Github Actions. You can always look up the latest (hopefully successful) build at (python-plugwise Github actions)[https://github.com/plugwise/python-plugwise/actions].
25+
`*) This states Smile as unfortunately tests for USB are still to be added`
26+
27+
Our tests are mainly conducted locally by the contributors and using Github Actions, see the workflows in `.github/workflows`. You can always look up the latest (hopefully successful) build at [python-plugwise Github actions](https://github.com/plugwise/python-plugwise/actions).
2228

23-
If you want to run tests locally, use the provided `scripts/setup.sh` to initialize and enable your virtualenv using `source venv/bin/activate`.
29+
If you want to run tests locally, use the provided `scripts/setup_test.sh` to initialize and enable your virtualenv using `source venv/bin/activate`.
2430

25-
Without your virtualenv, run the `scripts/setup_test.sh` script. With that (and your virtualenv enabled) you can run `scripts/tests_and_coverage.sh` or `scripts/complexity` to show areas that need Cyclometic Complexity improving.
31+
Without your virtualenv, run the `scripts/setup_test.sh` script. With that (and your virtualenv enabled) you can run `scripts/tests_and_coverage.sh` or `scripts/complexity.sh` to show areas that need Cyclometic Complexity improving.
2632

2733
## Quality
2834

29-
Code quality is checked (through Github Actions) at (CodeFactor)[https://www.codefactor.io/repository/github/plugwise/python-plugwise] and (codecov.io)[https://app.codecov.io/gh/plugwise/python-plugwise] as depicted by the badges on the (main repository page)[https://github.com/plugwise/python-plugwise].
35+
Code quality is checked (through [Github Actions](https://github.com/plugwise/python-plugwise/actions)) at [CodeFactor](https://www.codefactor.io/repository/github/plugwise/python-plugwise) and [codecov.io](https://app.codecov.io/gh/plugwise/python-plugwise) as depicted by the badges on the [main repository page](https://github.com/plugwise/python-plugwise).

0 commit comments

Comments
 (0)