-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0.1 release of ha-sagemcom-fast (#1)
- Loading branch information
Showing
39 changed files
with
755 additions
and
399 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
## Developing with Visual Studio Code + devcontainer | ||
|
||
The easiest way to get started with custom integration development is to use Visual Studio Code with devcontainers. This approach will create a preconfigured development environment with all the tools you need. | ||
|
||
In the container you will have a dedicated Home Assistant core instance running with your custom component code. You can configure this instance by updating the `./devcontainer/configuration.yaml` file. | ||
|
||
**Prerequisites** | ||
|
||
- [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) | ||
- Docker | ||
- For Linux, macOS, or Windows 10 Pro/Enterprise/Education use the [current release version of Docker](https://docs.docker.com/install/) | ||
- Windows 10 Home requires [WSL 2](https://docs.microsoft.com/windows/wsl/wsl2-install) and the current Edge version of Docker Desktop (see instructions [here](https://docs.docker.com/docker-for-windows/wsl-tech-preview/)). This can also be used for Windows Pro/Enterprise/Education. | ||
- [Visual Studio code](https://code.visualstudio.com/) | ||
- [Remote - Containers (VSC Extension)][extension-link] | ||
|
||
[More info about requirements and devcontainer in general](https://code.visualstudio.com/docs/remote/containers#_getting-started) | ||
|
||
[extension-link]: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers | ||
|
||
**Getting started:** | ||
|
||
1. Fork the repository. | ||
2. Clone the repository to your computer. | ||
3. Open the repository using Visual Studio code. | ||
|
||
When you open this repository with Visual Studio code you are asked to "Reopen in Container", this will start the build of the container. | ||
|
||
_If you don't see this notification, open the command palette and select `Remote-Containers: Reopen Folder in Container`._ | ||
|
||
### Tasks | ||
|
||
The devcontainer comes with some useful tasks to help you with development, you can start these tasks by opening the command palette and select `Tasks: Run Task` then select the task you want to run. | ||
|
||
When a task is currently running (like `Run Home Assistant on port 9123` for the docs), it can be restarted by opening the command palette and selecting `Tasks: Restart Running Task`, then select the task you want to restart. | ||
|
||
The available tasks are: | ||
|
||
Task | Description | ||
-- | -- | ||
Run Home Assistant on port 9123 | Launch Home Assistant with your custom component code and the configuration defined in `.devcontainer/configuration.yaml`. | ||
Run Home Assistant configuration against /config | Check the configuration. | ||
Upgrade Home Assistant to latest dev | Upgrade the Home Assistant core version in the container to the latest version of the `dev` branch. | ||
Install a specific version of Home Assistant | Install a specific version of Home Assistant core in the container. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
default_config: | ||
|
||
logger: | ||
default: error | ||
logs: | ||
custom_components.sagemcom_fast: debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// See https://aka.ms/vscode-remote/devcontainer.json for format details. | ||
{ | ||
"image": "ludeeus/container:integration", | ||
"context": "..", | ||
"appPort": [ | ||
"9123:8123" | ||
], | ||
"postCreateCommand": "container install", | ||
"runArgs": [ | ||
"-v", | ||
"${env:HOME}${env:USERPROFILE}/.ssh:/tmp/.ssh" | ||
], | ||
"extensions": [ | ||
"ms-python.vscode-pylance", | ||
"github.vscode-pull-request-github", | ||
], | ||
"settings": { | ||
"files.eol": "\n", | ||
"editor.tabSize": 4, | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"python.pythonPath": "/usr/bin/python3", | ||
"python.linting.pylintEnabled": true, | ||
"python.linting.enabled": true, | ||
"python.formatting.provider": "black", | ||
"editor.formatOnPaste": false, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnType": true, | ||
"files.trimTrailingWhitespace": true | ||
} | ||
} |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @iMicknl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
feature: ['feature/*', 'feat/*'] | ||
enhancement: enhancement/* | ||
bug: fix/* | ||
breaking: breaking/* | ||
documentation: doc/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name-template: 'v$NEXT_PATCH_VERSION' | ||
tag-template: 'v$NEXT_PATCH_VERSION' | ||
exclude-labels: | ||
- 'exclude-from-changelog' | ||
categories: | ||
- title: '⚠️ Breaking changes' | ||
label: 'breaking' | ||
- title: '🚀 Features' | ||
label: 'feature' | ||
- title: '✨ Enhancement' | ||
label: 'enhancement' | ||
- title: '📘 Documentation' | ||
label: 'documentation' | ||
- title: '🐛 Bug Fixes' | ||
label: 'bug' | ||
template: | | ||
## What's changed | ||
$CHANGES | ||
## Contributors to this release | ||
$CONTRIBUTORS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Linters (flake8, black, isort) | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "python", | ||
"pattern": [ | ||
{ | ||
"regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$", | ||
"file": 1, | ||
"line": 2 | ||
}, | ||
{ | ||
"regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$", | ||
"message": 2 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: PR Labeler | ||
on: | ||
pull_request_target: | ||
types: [opened] | ||
|
||
jobs: | ||
pr-labeler: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: TimonVS/pr-labeler-action@v3 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
update_release_draft: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Update release draft | ||
uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# yamllint disable rule:line-length | ||
name: Mark stale issues and pull requests | ||
|
||
on: | ||
schedule: | ||
- cron: "30 1 * * *" | ||
|
||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/stale@v3 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
stale-issue-message: > | ||
'There hasn't been any activity on this issue recently. Is this issue still present? | ||
Please make sure to update to the latest Home Assistant version and version of this integration to see | ||
if that solves the issue. Let us know if that works for you by adding a | ||
comment 👍. | ||
This issue now has been marked as stale and will be closed if no further | ||
activity occurs. Thank you for your contributions.' | ||
days-before-stale: 30 | ||
days-before-close: 5 | ||
stale-issue-label: 'no-issue-activity' | ||
exempt-issue-labels: 'work-in-progress,blocked,help wanted,under investigation' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Test (pytest) | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.7, 3.8] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.test.txt | ||
- name: Register Python problem matcher | ||
run: | | ||
echo "::add-matcher::.github/workflows/matchers/python.json" | ||
# - name: Install Pytest Annotation plugin | ||
# run: | | ||
# # Ideally this should be part of our dependencies | ||
# # However this plugin is fairly new and doesn't run correctly | ||
# # on a non-GitHub environment. | ||
# pip install pytest-github-actions-annotate-failures | ||
# - name: Test with pytest | ||
# run: | | ||
# pytest \ | ||
# --cov custom_components/sagemcom_fast \ | ||
# --cov-report=xml --cov-report=html \ | ||
# -o console_output_style=count \ | ||
# -p no:sugar \ | ||
# tests | ||
# - name: Upload coverage artifact | ||
# uses: actions/[email protected] | ||
# with: | ||
# name: coverage-${{ matrix.python-version }} | ||
# path: htmlcov |
Oops, something went wrong.