Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Commit

Permalink
fix dev environment
Browse files Browse the repository at this point in the history
- Updated Precommit config
- Fixed PyVIcare dependency to avoid test failure
- Updated documentation
  • Loading branch information
oischinger committed Aug 12, 2023
1 parent b65533b commit 0d630cf
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
venv
.vscode
*.code-workspace
*.pyc
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ repos:
- --configfile=tests/bandit.yaml
files: ^(homeassistant|script|tests)/.+\.py$
- repo: https://github.com/PyCQA/isort
rev: 5.11.4
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
39 changes: 37 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,49 @@

# Development

This custom component repository is unrelated to the [Home Assistant Core](https://github.com/home-assistant/core) repository.

Most of the times it is some commits ahead of the core repository.

## Development environment

### Install core dependencies:

Make sure your system has an up to date python version (ideally the same as required [here](https://developers.home-assistant.io/docs/development_environment)).

```
sudo apt-get update
sudo apt-get install python3-pip python3-dev python3-venv
```

### Create a venv

In the root directory of this repository create a venv initially:

```
python3 -m venv venv
```

Change to the venv:

```
source venv/bin/activate
```

### Install development and test dependencies

```
python3 -m pip install -r requirements_dev.txt
python3 -m pip install -r requirements_test.txt
```

### Run tests

Just run `pytest`

# Creating a PR

To create a PR to this repository please install this commit hook:

```
python3 -m pip install pre-commit
pre-commit install
Expand All @@ -22,4 +58,3 @@ Make sure to setup the development environment like as described [here](https://
Create a patch from a given commit e.g. with `git format-patch HEAD~1` and apply it on the HA Core repo with this command:

`git am -p2 --directory=homeassistant/components path_to_ha_vicare/custom_components/vicare/0001-some.patch`

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Open the `Configuration` of your Home-Assistant instance and select `Integration
Add a new integration, search and select `vicare`.
A dialog appears to enter your [ViCare API](https://developer.viessmann.com/start.html) credentials. Please see the documentation of the [official Home Assistant ViCare integration](https://www.home-assistant.io/integrations/vicare) for further details.

## Development

See [DEVELOPMENT.md](DEVELOPMENT.md) for how to set up a development environment and contribute.

## Links/Credits:

- [Original feature request in HA community](https://community.home-assistant.io/t/viessmann-component/77873)
Expand Down
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
PyViCare >= 2.25.0
PyViCare == 2.25.0
homeassistant >= 2023.4.1

1 comment on commit 0d630cf

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.