Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3491fef
Added testing infrastructure and test suite job
GrandMoff100 Jun 21, 2022
600981c
Added pytest tests
GrandMoff100 Jun 22, 2022
70b705f
Added testing server config
GrandMoff100 Jun 22, 2022
ab79430
Added test suite to CI/CD
GrandMoff100 Jun 22, 2022
7799307
Ignore test server files
GrandMoff100 Jun 22, 2022
c3cc5c3
Merge AsyncModels with regular models
GrandMoff100 Jun 22, 2022
ef67992
Tweak logbook model to match api
GrandMoff100 Jun 22, 2022
62ebdb4
Added explicit behavior of cache
GrandMoff100 Jun 22, 2022
0225938
Added get components method
GrandMoff100 Jun 22, 2022
3d253e3
Polished existing endpoints to conform to tests
GrandMoff100 Jun 22, 2022
af1e6af
Test Suite CI/CD syntax fix
GrandMoff100 Jun 22, 2022
593a7f7
Linted changes
GrandMoff100 Jun 22, 2022
4160233
Add cwd to PYTHONPATH
GrandMoff100 Jun 22, 2022
72bc872
Fixed non-preserved server between steps
GrandMoff100 Jun 22, 2022
049f283
Ping server instead of sleep
GrandMoff100 Jun 22, 2022
8010cfb
Fixed declare and assign sepparately
GrandMoff100 Jun 22, 2022
cca3bc2
[MegaLinter] Apply linters fixes
GrandMoff100 Jun 22, 2022
b36d7a9
Assert server running
GrandMoff100 Jun 22, 2022
822babc
Increase the timeout for packages install
GrandMoff100 Jun 22, 2022
dabc3ad
Integration heck has been overcome
GrandMoff100 Jun 23, 2022
243515c
Ahhhhhh added missing pip install poetry line
GrandMoff100 Jun 23, 2022
1dbb761
Silenced pip
GrandMoff100 Jun 23, 2022
fcfe309
Added debug messages
GrandMoff100 Jun 23, 2022
0b4d0af
Added log line grouping
GrandMoff100 Jun 23, 2022
6f13269
Enabled dev dependency install
GrandMoff100 Jun 23, 2022
e6a509c
Linted ci/cd files
GrandMoff100 Jun 23, 2022
717141a
Fixed more linting issues
GrandMoff100 Jun 23, 2022
328ac83
Added correct envs to final step
GrandMoff100 Jun 23, 2022
9aa5abe
Escape double quotes in :66:25
GrandMoff100 Jun 23, 2022
0eba24b
Lint yml files
GrandMoff100 Jun 23, 2022
54ecb5d
Reverse said linting
GrandMoff100 Jun 23, 2022
f56f012
Please lint
GrandMoff100 Jun 23, 2022
5a4ca60
Remove quotes from env variables
GrandMoff100 Jun 23, 2022
070b5a4
Fixed variable issues
GrandMoff100 Jun 23, 2022
da27d58
Move env variables into final step
GrandMoff100 Jun 23, 2022
10f825f
Maybe?
GrandMoff100 Jun 23, 2022
41676ee
Remove unused markdown files
GrandMoff100 Jun 24, 2022
03c6300
Fixed extra quote in bash script
GrandMoff100 Jun 24, 2022
1a0b724
Fixed variable assignation
GrandMoff100 Jun 24, 2022
83cfd96
[MegaLinter] Apply linters fixes
GrandMoff100 Jun 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Add This Feature?]"
title: "[Feature] Blah blah blah"
labels: enhancement
assignees: GrandMoff100

Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/code_rules.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
# MegaLinter GitHub Action configuration file
# More info at https://megalinter.github.io
name: MegaLinter
Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/test_suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Code Standards
on:
push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions)
paths:
- "**.py"
pull_request:
branches:
- master
- dev
paths:
- "**.py"
workflow_dispatch:
schedule:
- cron: 0 12 * * 6

jobs:
code_styling:
name: "Code Styling"
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v2
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
run: |
pip install poetry
poetry config virtualenvs.create false
poetry install
- name: Run Black
run: black homeassistant_api --check
- name: Run iSort
run: isort homeassistant_api --check-only
- name: Run Flake8
run: flake8 homeassistant_api
- name: Run MyPy
run: mypy homeassistant_api --show-error-codes
- name: Run PyLint
run: pylint homeassistant_api
code_functionality:
name: "Code Functionality"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install Dependencies
run: |
sudo apt-get -qq install -y libffi-dev \
libssl-dev libjpeg-dev zlib1g-dev \
autoconf build-essential libopenjp2-7 libtiff5 \
libturbojpeg0-dev tzdata
- name: Unpack Testing Server Config
run: |
unzip tests/homeassistant.zip
- name: Initialize Testing Server and Run Suite
run: |
echo "::group::Install Project Dependencies"
python3 -m pip install poetry
python3 -m poetry install
echo "::endgroup::"

echo "::group::Install Home Assistant Dependencies"
python3 -m venv .
. bin/activate
python3 -m pip install homeassistant
echo "::endgroup::"

echo "::group::Starting the Testing Server"
hass -c test_server/config &
deactivate

# Wait at least 60 seconds for server to install packages and start.
echo "::debug::Waiting for Server to Start"
sleep 60
echo "::endgroup::"

# Run Test Suite
echo "::group::Running Test Suite"
TOKEN="$(cat test_server/config/token.txt)"
export PYTHONPATH=.
export HOMEASSISTANTAPI_URL="http://localhost:8123/api"
export HOMEASSISTANTAPI_TOKEN="$TOKEN"
poetry run pytest tests --disable-warnings
echo "::endgroup::"
env:
HOMEASSISTANTAPI_URL: ${{ env.HOMEASSISTANTAPI_URL }}
HOMEASSISTANTAPI_TOKEN: ${{ env.HOMEASSISTANTAPI_TOKEN }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ report/
.replit
.breakpoints

# Cache files
*.sqlite

# Test Server
test_server/

# Distribution / packaging
.Python
build/
Expand Down
9 changes: 0 additions & 9 deletions .gitpod.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Configuration file for MegaLinter
# See all available variables at https://megalinter.github.io/configuration/ and in linters documentation

Expand All @@ -11,4 +12,5 @@ DISABLE_LINTERS:
SHOW_ELAPSED_TIME: true
FILEIO_REPORTER: true
RST_FILTER_REGEX_EXCLUDE: "(:resource:`.+`)"
ACTION_ACTIONLINT_ARGUMENTS: "-ignore spellcheck"
# DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass
44 changes: 0 additions & 44 deletions CHANGELOG.md

This file was deleted.

20 changes: 0 additions & 20 deletions TODO.md

This file was deleted.

14 changes: 0 additions & 14 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,6 @@ Data Models
.. autopydantic_model:: Event



.. automodule:: homeassistant_api._async.models

.. autopydantic_model:: AsyncDomain

.. autopydantic_model:: AsyncService

.. autopydantic_model:: AsyncGroup

.. autopydantic_model:: AsyncEntity

.. autopydantic_model:: AsyncEvent


Processing
-----------

Expand Down
20 changes: 13 additions & 7 deletions homeassistant_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
"""Imports all library stuff for convenience."""
"""Interact with your Homeassistant Instance remotely."""


__all__ = (
"Client",
"State",
"Service",
"History",
"Group",
"Event",
"Entity",
"Domain",
"AsyncService",
"AsyncGroup",
"AsyncEvent",
"AsyncEntity",
"AsyncDomain",
"Processing",
"LogbookEntry",
"APIConfigurationError",
"EndpointNotFoundError",
"HomeassistantAPIError",
"MalformedDataError",
"MalformedInputError",
"MethodNotAllowedError",
"ParameterMissingError",
"RequestError",
"UnauthorizedError",
"UnexpectedStatusCodeError",
)

from ._async import AsyncDomain, AsyncEntity, AsyncEvent, AsyncGroup, AsyncService
from .client import Client
from .errors import (
APIConfigurationError,
Expand Down
12 changes: 0 additions & 12 deletions homeassistant_api/_async/__init__.py

This file was deleted.

6 changes: 0 additions & 6 deletions homeassistant_api/_async/models/__init__.py

This file was deleted.

Loading