generated from dotKrad/blueprint
-
Notifications
You must be signed in to change notification settings - Fork 2
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 6e6e032
Showing
26 changed files
with
1,297 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,17 @@ | ||
FROM python:3.7 | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
git \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN python -m pip install --upgrade colorlog black pylint | ||
RUN python -m pip install --upgrade git+https://github.com/home-assistant/home-assistant@dev | ||
RUN cd && mkdir -p /config/custom_components | ||
|
||
|
||
WORKDIR /workspace | ||
|
||
# Set the default shell to bash instead of sh | ||
ENV SHELL /bin/bash |
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,53 @@ | ||
# Devcontainer | ||
|
||
_The easiest way to contribute to and/or test this repository._ | ||
|
||
## Requirements | ||
|
||
- [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) | ||
- [docker](https://docs.docker.com/install/) | ||
- [VS Code](https://code.visualstudio.com/) | ||
- [Remote - Containers (VSC Extention)](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) | ||
|
||
[More info about requirements and devcontainer in general](https://code.visualstudio.com/docs/remote/containers#_getting-started) | ||
|
||
## How to use Devcontainer for development/test | ||
|
||
1. Make sure your computer meets the requirements. | ||
1. Fork this repository. | ||
1. Clone the repository to your computer. | ||
1. Open the repository using VS Code. | ||
|
||
When you open this repository with VSCode and your computer meets the requirements you are asked to "Reopen in Container", do that. | ||
|
||
 | ||
|
||
If you don't see this notification, open the command pallet (ctrl+shift+p) and select `Remote-Containers: Reopen Folder in Container`. | ||
|
||
_It will now build the devcontainer._ | ||
|
||
The container have some "tasks" to help you testing your changes. | ||
|
||
## Custom Tasks in this repository | ||
|
||
_Start "tasks" by opening the the command pallet (ctrl+shift+p) and select `Tasks: Run Task`_ | ||
|
||
Running tasks like `Start Home Assistant on port 8124` can be restarted by opening the the command pallet (ctrl+shift+p) and select `Tasks: Restart Running Task`, then select the task you want to restart. | ||
|
||
### Start Home Assistant on port 8124 | ||
|
||
This will copy the configuration and the integration files to the expected location in the container. | ||
|
||
And start up Home Assistant on [port 8124.](http://localhost:8124) | ||
|
||
### Upgrade Home Assistant to latest dev | ||
|
||
This will upgrade Home Assistant to the latest dev version. | ||
|
||
### Set Home Assistant Version | ||
|
||
This allows you to specify a version of Home Assistant to install inside the devcontainer. | ||
|
||
### Home Assistant Config Check | ||
|
||
This runs a config check to make sure your config is valid. |
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 @@ | ||
default_config: | ||
logger: | ||
default: error | ||
logs: | ||
custom_components.blueprint: debug | ||
|
||
|
||
|
||
blueprint: | ||
username: my_username | ||
password: my_password | ||
binary_sensor: | ||
- enabled: true | ||
name: My custom name | ||
sensor: | ||
- enabled: true | ||
name: My custom name | ||
switch: | ||
- enabled: true | ||
name: My custom name |
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,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
function StartHomeAssistant { | ||
echo "Copy configuration.yaml" | ||
cp -f .devcontainer/configuration.yaml /config || echo ".devcontainer/configuration.yaml are missing!" exit 1 | ||
|
||
echo "Copy the custom component" | ||
rm -R /config/custom_components/ || echo "" | ||
cp -r custom_components /config/custom_components/ || echo "Could not copy the custom_component" exit 1 | ||
|
||
echo "Start Home Assistant" | ||
hass -c /config | ||
} | ||
|
||
function UpdgradeHomeAssistantDev { | ||
python -m pip install --upgrade git+https://github.com/home-assistant/home-assistant@dev | ||
} | ||
|
||
function SetHomeAssistantVersion { | ||
read -p 'Version: ' version | ||
python -m pip install --upgrade homeassistant==$version | ||
} | ||
|
||
function HomeAssistantConfigCheck { | ||
hass -c /config --script check_config | ||
} |
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,24 @@ | ||
// See https://aka.ms/vscode-remote/devcontainer.json for format details. | ||
{ | ||
"context": "..", | ||
"dockerFile": "Dockerfile", | ||
"appPort": "8124:8123", | ||
"runArgs": [ | ||
"-e", | ||
"GIT_EDTIOR='code --wait'" | ||
], | ||
"extensions": [ | ||
"ms-python.python", | ||
"tabnine.tabnine-vscode" | ||
], | ||
"settings": { | ||
"python.pythonPath": "/usr/local/bin/python", | ||
"python.linting.pylintEnabled": true, | ||
"python.linting.enabled": true, | ||
"python.formatting.provider": "black", | ||
"editor.formatOnPaste": false, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnType": true, | ||
"files.trimTrailingWhitespace": true | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,17 @@ | ||
--- | ||
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,42 @@ | ||
--- | ||
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,23 @@ | ||
repository: | ||
private: false | ||
has_issues: true | ||
has_projects: false | ||
has_wiki: false | ||
has_downloads: false | ||
default_branch: master | ||
allow_squash_merge: true | ||
allow_merge_commit: false | ||
allow_rebase_merge: false | ||
labels: | ||
- name: "Feature Request" | ||
color: "fbca04" | ||
- name: "Bug" | ||
color: "b60205" | ||
- name: "Wont Fix" | ||
color: "ffffff" | ||
- name: "Enhancement" | ||
color: a2eeef | ||
- name: "Documentation" | ||
color: "008672" | ||
- name: "Stale" | ||
color: "930191" |
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,61 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Start Home Assistant on port 8124", | ||
"type": "shell", | ||
"command": "source .devcontainer/custom_component_helper && StartHomeAssistant", | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true, | ||
}, | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Upgrade Home Assistant to latest dev", | ||
"type": "shell", | ||
"command": "source .devcontainer/custom_component_helper && UpdgradeHomeAssistantDev", | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true, | ||
}, | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Set Home Assistant Version", | ||
"type": "shell", | ||
"command": "source .devcontainer/custom_component_helper && SetHomeAssistantVersion", | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true, | ||
}, | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Home Assistant Config Check", | ||
"type": "shell", | ||
"command": "source .devcontainer/custom_component_helper && HomeAssistantConfigCheck", | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true, | ||
}, | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
}, | ||
"problemMatcher": [] | ||
} | ||
] | ||
} |
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,50 @@ | ||
# Contribution guidelines | ||
|
||
Contributing to this project should be as easy and transparent as possible, whether it's: | ||
|
||
- Reporting a bug | ||
- Discussing the current state of the code | ||
- Submitting a fix | ||
- Proposing new features | ||
|
||
## Github is used for everything | ||
|
||
Github is used to host code, to track issues and feature requests, as well as accept pull requests. | ||
|
||
Pull requests are the best way to propose changes to the codebase. | ||
|
||
1. Fork the repo and create your branch from `master`. | ||
2. If you've changed something, update the documentation. | ||
3. Make sure your code lints (using black). | ||
4. Issue that pull request! | ||
|
||
## Any contributions you make will be under the MIT Software License | ||
|
||
In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern. | ||
|
||
## Report bugs using Github's [issues](../../issues) | ||
|
||
GitHub issues are used to track public bugs. | ||
Report a bug by [opening a new issue](../../issues/new/choose); it's that easy! | ||
|
||
## Write bug reports with detail, background, and sample code | ||
|
||
**Great Bug Reports** tend to have: | ||
|
||
- A quick summary and/or background | ||
- Steps to reproduce | ||
- Be specific! | ||
- Give sample code if you can. | ||
- What you expected would happen | ||
- What actually happens | ||
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work) | ||
|
||
People *love* thorough bug reports. I'm not even kidding. | ||
|
||
## Use a Consistent Coding Style | ||
|
||
Use [black](https://github.com/ambv/black) to make sure the code follows the style. | ||
|
||
## License | ||
|
||
By contributing, you agree that your contributions will be licensed under its MIT License. |
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 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Joakim Sørensen @ludeeus | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.