forked from Schnitzel/hass-miner
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6c5f805
Showing
57 changed files
with
2,508 additions
and
0 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,10 @@ | ||
{ | ||
"_template": "gh:oncleben31/cookiecutter-homeassistant-custom-component", | ||
"class_name_prefix": "Miner", | ||
"domain_name": "miner", | ||
"friendly_name": "miner", | ||
"github_user": "Schnitzel", | ||
"project_name": "miner", | ||
"test_suite": "yes", | ||
"version": "0.0.0" | ||
} |
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,8 @@ | ||
default_config: | ||
|
||
logger: | ||
default: info | ||
logs: | ||
custom_components.miner: debug | ||
# If you need to debug uncommment the line below (doc: https://www.home-assistant.io/integrations/debugpy/) | ||
# debugpy: |
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": "ghcr.io/ludeeus/devcontainer/integration:stable", | ||
"name": "miner integration development", | ||
"context": "..", | ||
"appPort": [ | ||
"9123:8123" | ||
], | ||
"postCreateCommand": "container install", | ||
"extensions": [ | ||
"ms-python.python", | ||
"github.vscode-pull-request-github", | ||
"ryanluker.vscode-coverage-gutters", | ||
"ms-python.vscode-pylance" | ||
], | ||
"settings": { | ||
"files.eol": "\n", | ||
"editor.tabSize": 4, | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"python.pythonPath": "/usr/bin/python3", | ||
"python.analysis.autoSearchPaths": false, | ||
"python.linting.pylintEnabled": true, | ||
"python.linting.enabled": true, | ||
"python.formatting.provider": "black", | ||
"editor.formatOnPaste": false, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnType": true, | ||
"files.trimTrailingWhitespace": true | ||
} | ||
} |
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 @@ | ||
* text=auto eol=lf |
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,16 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
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,40 @@ | ||
--- | ||
name: Issue | ||
about: Create a report to help us improve | ||
--- | ||
|
||
<!-- Before you open a new issue, search through the existing issues to see if others have had the same problem. | ||
Issues not containing the minimum requirements will be closed: | ||
- Issues without a description (using the header is not good enough) will be closed. | ||
- Issues without debug logging will be closed. | ||
- Issues without configuration will be closed | ||
--> | ||
|
||
## Version of the custom_component | ||
|
||
<!-- If you are not using the newest version, download and try that before opening an issue | ||
If you are unsure about the version check the const.py file. | ||
--> | ||
|
||
## Configuration | ||
|
||
```yaml | ||
Add your logs here. | ||
``` | ||
|
||
## Describe the bug | ||
|
||
A clear and concise description of what the bug is. | ||
|
||
## Debug log | ||
|
||
<!-- To enable debug logs check this https://www.home-assistant.io/components/logger/ --> | ||
|
||
```text | ||
Add your logs here. | ||
``` |
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,14 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
- package-ecosystem: pip | ||
directory: "/.github/workflows" | ||
schedule: | ||
interval: daily | ||
- package-ecosystem: pip | ||
directory: "/" | ||
schedule: | ||
interval: daily |
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,66 @@ | ||
--- | ||
# Labels names are important as they are used by Release Drafter to decide | ||
# regarding where to record them in changelog or if to skip them. | ||
# | ||
# The repository labels will be automatically configured using this file and | ||
# the GitHub Action https://github.com/marketplace/actions/github-labeler. | ||
- name: breaking | ||
description: Breaking Changes | ||
color: bfd4f2 | ||
- name: bug | ||
description: Something isn't working | ||
color: d73a4a | ||
- name: build | ||
description: Build System and Dependencies | ||
color: bfdadc | ||
- name: ci | ||
description: Continuous Integration | ||
color: 4a97d6 | ||
- name: dependencies | ||
description: Pull requests that update a dependency file | ||
color: 0366d6 | ||
- name: documentation | ||
description: Improvements or additions to documentation | ||
color: 0075ca | ||
- name: duplicate | ||
description: This issue or pull request already exists | ||
color: cfd3d7 | ||
- name: enhancement | ||
description: New feature or request | ||
color: a2eeef | ||
- name: github_actions | ||
description: Pull requests that update Github_actions code | ||
color: "000000" | ||
- name: good first issue | ||
description: Good for newcomers | ||
color: 7057ff | ||
- name: help wanted | ||
description: Extra attention is needed | ||
color: 008672 | ||
- name: invalid | ||
description: This doesn't seem right | ||
color: e4e669 | ||
- name: performance | ||
description: Performance | ||
color: "016175" | ||
- name: python | ||
description: Pull requests that update Python code | ||
color: 2b67c6 | ||
- name: question | ||
description: Further information is requested | ||
color: d876e3 | ||
- name: refactoring | ||
description: Refactoring | ||
color: ef67c4 | ||
- name: removal | ||
description: Removals and Deprecations | ||
color: 9ae7ea | ||
- name: style | ||
description: Style | ||
color: c120e5 | ||
- name: testing | ||
description: Testing | ||
color: b1fc6f | ||
- name: wontfix | ||
description: This will not be worked on | ||
color: ffffff |
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,29 @@ | ||
categories: | ||
- title: ":boom: Breaking Changes" | ||
label: "breaking" | ||
- title: ":rocket: Features" | ||
label: "enhancement" | ||
- title: ":fire: Removals and Deprecations" | ||
label: "removal" | ||
- title: ":beetle: Fixes" | ||
label: "bug" | ||
- title: ":racehorse: Performance" | ||
label: "performance" | ||
- title: ":rotating_light: Testing" | ||
label: "testing" | ||
- title: ":construction_worker: Continuous Integration" | ||
label: "ci" | ||
- title: ":books: Documentation" | ||
label: "documentation" | ||
- title: ":hammer: Refactoring" | ||
label: "refactoring" | ||
- title: ":lipstick: Style" | ||
label: "style" | ||
- title: ":package: Dependencies" | ||
labels: | ||
- "dependencies" | ||
- "build" | ||
template: | | ||
## Changes | ||
$CHANGES |
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 @@ | ||
pip==21.0 | ||
pre-commit==2.9.3 | ||
black==20.8b1 | ||
flake8==3.8.4 | ||
reorder-python-imports==2.3.6 |
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,20 @@ | ||
name: Manage labels | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
|
||
jobs: | ||
labeler: | ||
name: Labeler | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/[email protected] | ||
|
||
- name: Run Labeler | ||
uses: crazy-max/[email protected] | ||
with: | ||
skip-delete: true |
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: Draft a release note | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
jobs: | ||
draft_release: | ||
name: Release Drafter | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Run release-drafter | ||
uses: release-drafter/[email protected] | ||
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,85 @@ | ||
name: Linting | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
- dev | ||
pull_request: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
env: | ||
DEFAULT_PYTHON: 3.9 | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: "ubuntu-latest" | ||
name: Pre-commit | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/[email protected] | ||
|
||
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
|
||
- name: Upgrade pip | ||
run: | | ||
pip install --constraint=.github/workflows/constraints.txt pip | ||
pip --version | ||
- name: Install Python modules | ||
run: | | ||
pip install --constraint=.github/workflows/constraints.txt pre-commit black flake8 reorder-python-imports | ||
- name: Run pre-commit on all files | ||
run: | | ||
pre-commit run --all-files --show-diff-on-failure --color=always | ||
hacs: | ||
runs-on: "ubuntu-latest" | ||
name: HACS | ||
steps: | ||
- name: Check out the repository | ||
uses: "actions/[email protected]" | ||
|
||
- name: HACS validation | ||
uses: "hacs/[email protected]" | ||
with: | ||
category: "integration" | ||
ignore: brands | ||
|
||
hassfest: | ||
runs-on: "ubuntu-latest" | ||
name: Hassfest | ||
steps: | ||
- name: Check out the repository | ||
uses: "actions/[email protected]" | ||
|
||
- name: Hassfest validation | ||
uses: "home-assistant/actions/hassfest@master" | ||
tests: | ||
runs-on: "ubuntu-latest" | ||
name: Run tests | ||
steps: | ||
- name: Check out code from GitHub | ||
uses: "actions/[email protected]" | ||
- name: Setup Python ${{ env.DEFAULT_PYTHON }} | ||
uses: "actions/[email protected]" | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
- name: Install requirements | ||
run: | | ||
pip install --constraint=.github/workflows/constraints.txt pip | ||
pip install -r requirements_test.txt | ||
- name: Tests suite | ||
run: | | ||
pytest \ | ||
--timeout=9 \ | ||
--durations=10 \ | ||
-n auto \ | ||
-p no:sugar \ | ||
tests |
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 @@ | ||
__pycache__ | ||
pythonenv* | ||
.python-version | ||
.coverage | ||
venv | ||
.venv |
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,32 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.3.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: local | ||
hooks: | ||
- id: black | ||
name: black | ||
entry: black | ||
language: system | ||
types: [python] | ||
require_serial: true | ||
- id: flake8 | ||
name: flake8 | ||
entry: flake8 | ||
language: system | ||
types: [python] | ||
require_serial: true | ||
- id: reorder-python-imports | ||
name: Reorder python imports | ||
entry: reorder-python-imports | ||
language: system | ||
types: [python] | ||
args: [--application-directories=custom_components] | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v2.2.1 | ||
hooks: | ||
- id: prettier |
Oops, something went wrong.