Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sebr/bhyve-home-assistant
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.0.7
Choose a base ref
...
head repository: sebr/bhyve-home-assistant
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 2,446 additions and 818 deletions.
  1. +41 −0 .devcontainer.json
  2. +1 −0 .gitattributes
  3. +8 −26 .github/ISSUE_TEMPLATE/bug_report.md
  4. +2 −1 .github/ISSUE_TEMPLATE/feature_request.md
  5. +42 −0 .github/ISSUE_TEMPLATE/new_device.md
  6. +15 −0 .github/dependabot.yml
  7. +0 −14 .github/workflows/hassfest.yaml
  8. +32 −0 .github/workflows/lint.yml
  9. +29 −0 .github/workflows/release.yml
  10. +37 −0 .github/workflows/validate.yml
  11. +18 −2 .gitignore
  12. +14 −0 .vscode/extensions.json
  13. +14 −3 .vscode/settings.json
  14. +17 −0 .vscode/tasks.json
  15. +61 −0 .yamllint
  16. +0 −40 CHANGELOG.md
  17. +1 −1 LICENSE
  18. +74 −25 README.md
  19. +11 −0 config/configuration.yaml
  20. +170 −144 custom_components/bhyve/__init__.py
  21. +138 −0 custom_components/bhyve/binary_sensor.py
  22. +219 −0 custom_components/bhyve/config_flow.py
  23. +10 −3 custom_components/bhyve/const.py
  24. +39 −0 custom_components/bhyve/diagnostics.py
  25. +6 −5 custom_components/bhyve/manifest.json
  26. +2 −1 custom_components/bhyve/pybhyve/__init__.py
  27. +105 −43 custom_components/bhyve/pybhyve/client.py
  28. +2 −0 custom_components/bhyve/pybhyve/const.py
  29. +3 −5 custom_components/bhyve/pybhyve/errors.py
  30. +17 −0 custom_components/bhyve/pybhyve/typings.py
  31. +51 −35 custom_components/bhyve/pybhyve/websocket.py
  32. +239 −58 custom_components/bhyve/sensor.py
  33. +17 −2 custom_components/bhyve/services.yaml
  34. +138 −0 custom_components/bhyve/strings.json
  35. +394 −169 custom_components/bhyve/switch.py
  36. +138 −0 custom_components/bhyve/translations/en.json
  37. +24 −7 custom_components/bhyve/util.py
  38. +45 −0 debug/debug.py
  39. +2 −2 hacs.json
  40. +0 −209 info.md
  41. +156 −0 pyproject.toml
  42. +42 −23 python_scripts/bhyve_next_watering.py
  43. +11 −0 requirements.txt
  44. +26 −0 ruff.toml
  45. +20 −0 scripts/develop
  46. +8 −0 scripts/lint
  47. +7 −0 scripts/setup
41 changes: 41 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "ludeeus/integration_blueprint",
"image": "mcr.microsoft.com/devcontainers/python:3.12",
"postCreateCommand": "scripts/setup",
"forwardPorts": [
8123
],
"portsAttributes": {
"8123": {
"label": "Home Assistant",
"onAutoForward": "notify"
}
},
"customizations": {
"vscode": {
"extensions": [
"charliermarsh.ruff",
"github.vscode-pull-request-github",
"ms-python.python",
"ms-python.vscode-pylance",
"ryanluker.vscode-coverage-gutters"
],
"settings": {
"files.eol": "\n",
"editor.tabSize": 4,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnType": false,
"files.trimTrailingWhitespace": true,
"python.analysis.typeCheckingMode": "basic",
"python.analysis.autoImportCompletions": true,
"python.defaultInterpreterPath": "/usr/local/bin/python",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
}
}
}
},
"remoteUser": "vscode",
"features": {}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
34 changes: 8 additions & 26 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,8 @@ name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
assignees:
- sebr

---

@@ -16,32 +17,13 @@ assignees: ''
**BHyve devices**
<!-- Please detail the number and types of devices in your BHyve configuration. -->

**Logs**
**Device Diagnostics**
<!--
Attach device logs.
Step 1: Enable debugging.
Please attach the Home Assistant diagnostics for the B-hyve device. Sensitive information is redacted when compiling the diagnostic data.
Add the following to `configuration.yaml` and then restart Home Assistant.
```
logger:
logs:
custom_components.bhyve: debug
```
* Home Assistant diagnostics: https://www.home-assistant.io/integrations/diagnostics/
* Diagnostic data implementation: https://github.com/sebr/bhyve-home-assistant/blob/main/custom_components/bhyve/diagnostics.py
* Example of how to generate: https://user-images.githubusercontent.com/81972/179869298-3d2a33ca-f847-4a25-8e77-20757e49f914.png
Step 2: Check Home Assistant logs
1. Open `home-assistant.log`
2. Identify lines which begin with:
```log
DEBUG (MainThread) [custom_components.bhyve] Devices:
DEBUG (MainThread) [custom_components.bhyve] Programs:
```
Copy these two lines and paste them below.
-->

```log
DEBUG (MainThread) [custom_components.bhyve] Devices:
DEBUG (MainThread) [custom_components.bhyve] Programs:
```
-->
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,8 @@ name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
assignees:
- sebr

---

42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/new_device.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Support a new device
about: Create a request to support a new BHyve device
title: ''
labels: ''
assignees:
- sebr

---

**Describe the new device**
<!-- A clear and concise description of the device, including any reference links. -->

**Logs**
<!--
Attach device logs.
Step 1: Enable debugging.
Add the following to `configuration.yaml` and then restart Home Assistant.
```
logger:
logs:
custom_components.bhyve: debug
```
Step 2: Check Home Assistant logs
1. Open `home-assistant.log`
2. Identify lines which begin with:
```log
DEBUG (MainThread) [custom_components.bhyve] Devices:
DEBUG (MainThread) [custom_components.bhyve] Programs:
```
Copy these two lines and paste them below.
-->

```log
DEBUG (MainThread) [custom_components.bhyve] Devices:
DEBUG (MainThread) [custom_components.bhyve] Programs:
```
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
ignore:
# Dependabot should not update Home Assistant as that should match the homeassistant key in hacs.json
- dependency-name: "homeassistant"
14 changes: 0 additions & 14 deletions .github/workflows/hassfest.yaml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Lint"

on:
push:
branches:
- "main"
pull_request:
branches:
- "main"

jobs:
ruff:
name: "Ruff"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/checkout@v4.2.2"

- name: "Set up Python"
uses: actions/setup-python@v5.3.0
with:
python-version: "3.12"
cache: "pip"

- name: "Install requirements"
run: python3 -m pip install -r requirements.txt

- name: "Lint"
run: python3 -m ruff check .

- name: "Format"
run: python3 -m ruff format . --check
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Release"

on:
release:
types:
- "published"

permissions: {}

jobs:
release:
name: "Release"
runs-on: "ubuntu-latest"
permissions:
contents: write
steps:
- name: "Checkout the repository"
uses: "actions/checkout@v4.2.2"

- name: "ZIP the integration directory"
shell: "bash"
run: |
cd "${{ github.workspace }}/custom_components/inception"
zip inception.zip -r ./
- name: "Upload the ZIP file to the release"
uses: "softprops/action-gh-release@v2.2.1"
with:
files: ${{ github.workspace }}/custom_components/inception/inception.zip
37 changes: 37 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Validate"

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
push:
branches:
- "main"
pull_request:
branches:
- "main"

jobs:
hassfest: # https://developers.home-assistant.io/blog/2020/04/16/hassfest
name: "Hassfest Validation"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/checkout@v4.2.2"

- name: "Run hassfest validation"
uses: "home-assistant/actions/hassfest@master"

hacs: # https://github.com/hacs/action
name: "HACS Validation"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/checkout@v4.2.2"

- name: "Run HACS validation"
uses: "hacs/action@main"
with:
category: "integration"
# Remove this 'ignore' key when you have added brand images for your integration to https://github.com/home-assistant/brands
ignore: "brands"
20 changes: 18 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
# artifacts
__pycache__
*.pyc
.pytest*
*.egg-info
*/build/*
*/dist/*

tmp

# misc
.coverage
.vscode
coverage.xml
.ruff_cache

debug/[0-9]*
debug/sync

# Home Assistant configuration
config/*
!config/configuration.yaml
14 changes: 14 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"ms-python.black-formatter",
"ms-python.python"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [

]
}
17 changes: 14 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
{
"python.formatting.provider": "black",
"python.pythonPath": "/usr/local/bin/python3",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.linting.pylintEnabled": true
"python.linting.pylintArgs": ["--disable", "import-error"],
"python.formatting.provider": "none",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"python.analysis.autoImportCompletions": false,
"python.analysis.diagnosticSeverityOverrides": {
"reportMissingImports": "none"
},
"python.testing.pytestEnabled": false,
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
},
}
17 changes: 17 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Run Home Assistant on port 8123",
"type": "shell",
"command": "scripts/develop",
"problemMatcher": []
},
{
"label": "Lint (run pre-commit hooks)",
"type": "shell",
"command": "scripts/lint",
"problemMatcher": []
}
]
}
Loading