Skip to content

Commit

Permalink
Merge pull request #2 from krahabb/dev
Browse files Browse the repository at this point in the history
Update environment and code to current HA core
  • Loading branch information
krahabb authored Jan 17, 2024
2 parents ff15822 + 7a5e656 commit cfe7cb3
Show file tree
Hide file tree
Showing 23 changed files with 1,289 additions and 1,028 deletions.
8 changes: 1 addition & 7 deletions .devcontainer/configuration.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
default_config:

homeassistant:
#external_url: http://192.168.1.201:9124
#internal_url: http://192.168.1.64:8123


stream:


logger:
default: info
default: warning
logs:
custom_components.motion_frontend: debug

Expand Down
59 changes: 30 additions & 29 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
{
"image": "ludeeus/container:integration-debian",
"name": "Blueprint integration development",
"context": "..",
"appPort": [
"9124:8123"
],
"forwardPorts": [8080, 8081],
"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
}
"name": "ludeeus/integration_blueprint/motion_frontend",
"image": "mcr.microsoft.com/devcontainers/python:3.11",
"runArgs": [ "--network=host" ],
"postCreateCommand": "scripts/setup",
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance"
],
"settings": {
"files.eol": "\n",
"editor.tabSize": 4,
"python.pythonPath": "/usr/bin/python3",
"python.analysis.autoSearchPaths": false,
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.formatting.provider": "black",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true
}
}
},
"remoteUser": "root",
"features": {
"ghcr.io/devcontainers/features/rust:1": {}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: "ubuntu-latest"
name: Validate
steps:
- uses: "actions/checkout@v2"
- uses: "actions/checkout@v3"

- name: HACS validation
uses: "hacs/action@main"
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ name: Pull actions
on:
pull_request:

env:
DEFAULT_PYTHON: "3.11"

jobs:
validate:
runs-on: "ubuntu-latest"
name: Validate
steps:
- uses: "actions/checkout@v2"
- uses: "actions/checkout@v3"

- name: HACS validation
uses: "hacs/action@main"
Expand All @@ -23,10 +26,10 @@ jobs:
runs-on: "ubuntu-latest"
name: Check style formatting
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v1"
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
with:
python-version: "3.x"
python-version: ${{ env.DEFAULT_PYTHON }}
- run: python3 -m pip install black
- run: black .

Expand All @@ -35,21 +38,21 @@ jobs:
name: Run tests
steps:
- name: Check out code from GitHub
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
- name: Setup Python
uses: "actions/setup-python@v1"
uses: "actions/setup-python@v4"
with:
python-version: "3.8"
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Install requirements
run: python3 -m pip install -r requirements_test.txt
- name: Run tests
run: |
pytest \
-qq \
--timeout=9 \
--timeout=60 \
--durations=10 \
-n auto \
--cov custom_components.integration_blueprint \
--cov custom_components.motion_frontend \
-o console_output_style=count \
-p no:sugar \
tests
27 changes: 13 additions & 14 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
name: Push actions

on:
push:
branches:
- master
- dev
on: push

env:
DEFAULT_PYTHON: "3.11"

jobs:
validate:
runs-on: "ubuntu-latest"
name: Validate
steps:
- uses: "actions/checkout@v2"
- uses: "actions/checkout@v3"

- name: HACS validation
uses: "hacs/action@main"
Expand All @@ -26,10 +25,10 @@ jobs:
runs-on: "ubuntu-latest"
name: Check style formatting
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v1"
- uses: "actions/checkout@v3"
- uses: "actions/setup-python@v4"
with:
python-version: "3.x"
python-version: ${{ env.DEFAULT_PYTHON }}
- run: python3 -m pip install black
- run: black .

Expand All @@ -38,21 +37,21 @@ jobs:
name: Run tests
steps:
- name: Check out code from GitHub
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
- name: Setup Python
uses: "actions/setup-python@v1"
uses: "actions/setup-python@v4"
with:
python-version: "3.8"
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Install requirements
run: python3 -m pip install -r requirements_test.txt
- name: Run tests
run: |
pytest \
-qq \
--timeout=9 \
--timeout=60 \
--durations=10 \
-n auto \
--cov custom_components.integration_blueprint \
--cov custom_components.motion_frontend \
-o console_output_style=count \
-p no:sugar \
tests
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ venv
.coverage
.ropeproject
*.secret
*.user
*.secret.json
*.user
traces
.DS_Store
config
19 changes: 16 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
{
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.pythonPath": "/usr/local/bin/python",
"files.associations": {
"*.yaml": "home-assistant"
},
"python.analysis.typeCheckingMode": "basic",
"python.analysis.diagnosticSeverityOverrides": {
"reportShadowedImports": "none"
},
"python.analysis.extraPaths": [
"./custom_components/motion_frontend"
],
"testing.defaultGutterClickAction": "debug",
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": [
"tests"
],
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
}
}
18 changes: 3 additions & 15 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,15 @@
"version": "2.0.0",
"tasks": [
{
"label": "Run Home Assistant on port 9123",
"label": "Run Home Assistant on port 8123",
"type": "shell",
"command": "container start",
"problemMatcher": []
},
{
"label": "Run Home Assistant configuration against /config",
"type": "shell",
"command": "container check",
"command": "scripts/develop",
"problemMatcher": []
},
{
"label": "Upgrade Home Assistant to latest dev",
"type": "shell",
"command": "container install",
"problemMatcher": []
},
{
"label": "Install a specific version of Home Assistant",
"type": "shell",
"command": "container set-version",
"command": "pip3 install --upgrade git+https://github.com/home-assistant/core.git@dev",
"problemMatcher": []
}
]
Expand Down
Loading

0 comments on commit cfe7cb3

Please sign in to comment.