diff --git a/.github/workflows/typing.yaml b/.github/workflows/typing.yaml index 84efeb4d..78217235 100644 --- a/.github/workflows/typing.yaml +++ b/.github/workflows/typing.yaml @@ -49,4 +49,4 @@ jobs: - name: 🏗 Install dependencies run: poetry install --no-interaction - name: 🚀 Run mypy - run: poetry run mypy omnikinverter tests + run: poetry run mypy omnikinverter tests examples diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c7dc7e3..9a3fca6c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -153,3 +153,8 @@ repos: language: system types: [yaml] entry: poetry run yamllint + - id: mypy + name: 🆎 Static type checking using mypy + language: system + types: [python] + entry: poetry run mypy diff --git a/test_output.py b/examples/test_output.py similarity index 85% rename from test_output.py rename to examples/test_output.py index b9cc56dd..449bcf06 100644 --- a/test_output.py +++ b/examples/test_output.py @@ -3,17 +3,17 @@ import asyncio -from omnikinverter import OmnikInverter +from omnikinverter import Device, Inverter, OmnikInverter -async def main(): +async def main() -> None: """Test.""" async with OmnikInverter( host="examples.com", source_type="javascript", ) as client: - inverter: OmnikInverter = await client.inverter() - device: OmnikInverter = await client.device() + inverter: Inverter = await client.inverter() + device: Device = await client.device() print(inverter) print() print("-- INVERTER --")