Skip to content

Commit

Permalink
Asyncio support (#7)
Browse files Browse the repository at this point in the history
Add asyncio support
  • Loading branch information
speijnik authored Aug 31, 2021
1 parent e2fcfde commit 9fd0e2a
Show file tree
Hide file tree
Showing 75 changed files with 3,567 additions and 2,731 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/dist
/.coverage
4 changes: 3 additions & 1 deletion .openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

myhome/__init__.py
myhome/_gen/docs/*.md
myhome/_gen/api_client.py
myhome/_gen/apis/
myhome/_gen/models/
myhome/_gen/docs/
myhome/_gen_README.md
3 changes: 0 additions & 3 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
myhome/_gen/__init__.py
myhome/_gen/api/__init__.py
myhome/_gen/api/default_api.py
myhome/_gen/api_client.py
myhome/_gen/apis/__init__.py
myhome/_gen/configuration.py
myhome/_gen/exceptions.py
myhome/_gen/model/__init__.py
Expand Down Expand Up @@ -32,7 +30,6 @@ myhome/_gen/model/system_info.py
myhome/_gen/model/zone.py
myhome/_gen/model/zone_list.py
myhome/_gen/model_utils.py
myhome/_gen/models/__init__.py
myhome/_gen/rest.py
myhome/_gen/test/__init__.py
myhome/_gen/test/test_access_status.py
Expand Down
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ repos:
- --safe
- --quiet
files: ^((myhome|tests)/.+)?[^/]+\.py$
exclude: ^myhome/_gen/
- repo: https://github.com/codespell-project/codespell
rev: v2.0.0
hooks:
Expand All @@ -36,7 +35,7 @@ repos:
- flake8-noqa==1.1.0
- mccabe==0.6.1
files: ^(myhome|tests)/.+\.py$
exclude: ^myhome/_gen/
exclude: ^(myhome|tests)/_gen/
- repo: https://github.com/PyCQA/bandit
rev: 1.7.0
hooks:
Expand Down
8 changes: 7 additions & 1 deletion contrib/generate_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ THIS_DIR=$(dirname ${THIS_PATH})
source "${THIS_DIR}/generator_common.sh"

echo "Removing old generated client..."
rm -rf "${THIS_DIR}/../myhome/_gen"
rm -rf "${THIS_DIR}/../myhome/_gen" "${THIS_DIR}/../tests/_gen"

echo "Generating API client..."
${OPENAPI_GENERATOR} generate \
-g python \
-c "${THIS_WORK_PATH}/.openapi_codegen_python.yml" \
-i "${THIS_WORK_PATH}/openapi.yml" \
-o "${WORK_PATH}"

if test -d "${THIS_DIR}/../myhome/_gen/test"
then
echo "Moving tests to top-level tests directory"
mv "${THIS_DIR}/../myhome/_gen/test" "${THIS_DIR}/../tests/_gen"
fi
6 changes: 5 additions & 1 deletion contrib/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,8 @@ components:

object-value:
oneOf:
- $ref: '#/components/schemas/object-value-light'
- $ref: '#/components/schemas/object-value-dimmer'
- $ref: '#/components/schemas/object-value-light'
- $ref: '#/components/schemas/object-value-shutter'
- $ref: '#/components/schemas/object-value-thermostat'

Expand All @@ -408,13 +408,17 @@ components:
object-value-dimmer:
type: object
required:
- power
- dimmer
properties:
dimmer:
type: integer
maximum: 100
minimum: 0
description: 'Dimming percentage'
power:
type: boolean
description: 'Power on/off'

object-value-shutter:
type: object
Expand Down
2 changes: 1 addition & 1 deletion myhome/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
at https://github.com/speijnik/myhome/tree/main/doc/
"""

__version__ = "0.1.0"
__version__ = "0.3.0"
Loading

0 comments on commit 9fd0e2a

Please sign in to comment.