Spring cleaning ☀️ (#23)

* Spring cleaning

* Actions

* Fix branches

* Changes for config_flow
This commit is contained in:
Joakim Sørensen
2020-04-17 19:42:59 +02:00
committed by GitHub
parent d408fbec4a
commit a53b0f75a1
28 changed files with 349 additions and 731 deletions

View File

@ -1,17 +0,0 @@
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

View File

@ -1,53 +0,0 @@
# 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.
![reopen](images/reopen.png)
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.

View File

@ -2,19 +2,4 @@ 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
custom_components.blueprint: debug

View File

@ -1,26 +0,0 @@
#!/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
}

View File

@ -1,18 +1,25 @@
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
{
"image": "ludeeus/container:integration",
"context": "..",
"dockerFile": "Dockerfile",
"appPort": "8124:8123",
"appPort": [
"9123:8123"
],
"postCreateCommand": "dc install",
"runArgs": [
"-e",
"GIT_EDTIOR='code --wait'"
"-v",
"${env:HOME}${env:USERPROFILE}/.ssh:/tmp/.ssh"
],
"extensions": [
"ms-python.python",
"github.vscode-pull-request-github",
"tabnine.tabnine-vscode"
],
"settings": {
"python.pythonPath": "/usr/local/bin/python",
"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",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB