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: GrandMoff100/HomeAssistantAPI
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.0.0.post1
Choose a base ref
...
head repository: GrandMoff100/HomeAssistantAPI
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dev
Choose a head ref
Loading
Showing with 3,880 additions and 2,627 deletions.
  1. +0 −97 .cspell.json
  2. +22 −0 .dockerignore
  3. +0 −74 .github/workflows/codeql-analysis.yml
  4. +0 −83 .github/workflows/mega-linter.yml
  5. +31 −7 .github/workflows/python-publish.yml
  6. +65 −0 .github/workflows/test-suite.yml
  7. +0 −98 .github/workflows/test_suite.yml
  8. +10 −4 .gitignore
  9. +0 −15 .jscpd.json
  10. +0 −16 .mega-linter.yml
  11. +3 −16 .pre-commit-config.yaml
  12. +5 −5 .readthedocs.yml
  13. +7 −0 .vscode/settings.json
  14. +20 −0 Dockerfile
  15. +0 −53 LICENSE
  16. +43 −8 README.md
  17. +26 −0 compose.yml
  18. +2 −3 docs/CONTRIBUTING.rst
  19. +26 −4 docs/advanced.rst
  20. +2 −2 docs/api.rst
  21. +6 −9 docs/conf.py
  22. +3 −2 docs/index.rst
  23. +93 −6 docs/usage.rst
  24. +3 −0 entrypoint.sh
  25. +1 −1 examples/async_get_entities.py
  26. 0 firstbot.py
  27. +34 −33 homeassistant_api/__init__.py
  28. +25 −6 homeassistant_api/client.py
  29. +16 −6 homeassistant_api/errors.py
  30. +1 −0 homeassistant_api/models/__init__.py
  31. +11 −11 homeassistant_api/models/base.py
  32. +85 −29 homeassistant_api/models/domains.py
  33. +2 −2 homeassistant_api/models/entity.py
  34. +2 −1 homeassistant_api/models/history.py
  35. +3 −3 homeassistant_api/models/logbook.py
  36. +22 −5 homeassistant_api/models/states.py
  37. +97 −0 homeassistant_api/models/websocket.py
  38. +25 −18 homeassistant_api/processing.py
  39. +134 −47 homeassistant_api/rawasyncclient.py
  40. +10 −40 homeassistant_api/rawbaseclient.py
  41. +127 −49 homeassistant_api/rawclient.py
  42. +199 −0 homeassistant_api/rawwebsocket.py
  43. +32 −0 homeassistant_api/utils.py
  44. +378 −0 homeassistant_api/websocket.py
  45. 0 main.py
  46. +1,658 −1,772 poetry.lock
  47. +53 −37 pyproject.toml
  48. +0 −24 scripts/make_test_server
  49. +1 −0 scripts/{run_docs_dev → run_docs_dev.sh}
  50. +38 −6 tests/conftest.py
  51. BIN tests/homeassistant.zip
  52. +11 −1 tests/test_client.py
  53. +94 −4 tests/test_endpoints.py
  54. +28 −20 tests/test_errors.py
  55. +30 −0 tests/test_events.py
  56. +5 −4 tests/test_models.py
  57. +0 −4 tox.ini
  58. +154 −0 volumes/config/.storage/auth
  59. +13 −0 volumes/config/.storage/auth_provider.homeassistant
  60. +15 −0 volumes/config/.storage/core.analytics
  61. +42 −0 volumes/config/.storage/core.area_registry
  62. +19 −0 volumes/config/.storage/core.config
  63. +12 −0 volumes/config/.storage/core.config_entries
  64. +12 −0 volumes/config/.storage/core.device_registry
  65. +21 −0 volumes/config/.storage/core.entity_registry
  66. +12 −0 volumes/config/.storage/core.restore_state
  67. +15 −0 volumes/config/.storage/frontend.user_data_e85fc7b7b8924dc9b024ce90ad23799e
  68. +23 −0 volumes/config/.storage/http
  69. +8 −0 volumes/config/.storage/http.auth
  70. +13 −0 volumes/config/.storage/onboarding
  71. +16 −0 volumes/config/.storage/person
  72. +8 −0 volumes/config/.storage/repairs.issue_registry
  73. +6 −0 volumes/config/.storage/trace.saved_traces
  74. +1 −2 tests/server_config.yaml → volumes/config/configuration.yaml
  75. +1 −0 volumes/token.txt
97 changes: 0 additions & 97 deletions .cspell.json

This file was deleted.

22 changes: 22 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Repository
.github/
.mypy_cache/
.ruff_cache/
.venv/
docs/
examples/
scripts/
.gitignore
.pre-commit-config.yaml
.readthedocs.yml
CODE_OF_CONDUCT.md
LICENSE

# Python
__pycache__/
*.egg-info/
*.egg/
build/
dist/
*.pyc
*.pyo
74 changes: 0 additions & 74 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

83 changes: 0 additions & 83 deletions .github/workflows/mega-linter.yml

This file was deleted.

38 changes: 31 additions & 7 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -7,10 +7,11 @@ on:
workflow_dispatch:

jobs:
deploy:
build:
runs-on: ubuntu-latest
environment: "Python Package Deployment"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
@@ -20,8 +21,31 @@ jobs:
python -m pip install --upgrade pip poetry
poetry config virtualenvs.create false
poetry install
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: poetry publish --build -u "$TWINE_USERNAME" -p "$TWINE_PASSWORD"
- name: build release distributions
run: |
# NOTE: put your own distribution build steps here.
poetry build
- name: upload dists
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/

publish:
runs-on: ubuntu-latest
environment: "Python Package Deployment"
permissions:
id-token: write
needs:
- build
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/

- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
65 changes: 65 additions & 0 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Code Standards
on:
push:
paths:
- "**.py"
- "pyproject.toml"
- "poetry.lock"
pull_request:
branches:
- master
- dev
paths:
- "**.py"
- "pyproject.toml"
- "poetry.lock"
workflow_dispatch:

jobs:
code_styling:
name: "Code Styling"
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
run: |
pip install poetry
poetry install --with styling
- name: Run Ruff
run: poetry run ruff homeassistant_api
- name: Run MyPy
run: poetry run mypy homeassistant_api --show-error-codes

code_functionality:
name: "Code Functionality"
runs-on: ubuntu-latest
environment: "Test Suite"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Pre Docker Setup
run: |
mkdir volumes/coverage
- name: Run Test Environment
run: |
docker compose up --build --exit-code-from tests
env:
HOMEASSISTANTAPI_TOKEN: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkMDE4YjQ4YzMyZTE0ODNhYjY2ZWQzOTZmYzg3ZDAyNiIsImlhdCI6MTY3ODU3NDUwMSwiZXhwIjoxOTkzOTM0NTAxfQ.fyhnfwpont4uE0gn46_Ut_pPmyn4QWv0MDaVAei2PPk" # This is non-sensitive data
- name: Post Docker Setup
run: |
sudo chown -R $USER volumes
- name: Upload Coverage Report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./volumes/coverage/coverage.xml
verbose: true
Loading