diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index be73e45..8808820 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,8 +27,8 @@ jobs: uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: "3.14" - - name: Install prek - run: pip install prek==0.4.0 + - name: Install dependencies + run: pip install -r requirements_lint.txt - name: Run prek run: prek run --all-files --skip no-commit-to-branch build: diff --git a/EXTERNAL_SESSION.md b/EXTERNAL_SESSION.md index cac8d57..ed608b1 100644 --- a/EXTERNAL_SESSION.md +++ b/EXTERNAL_SESSION.md @@ -19,6 +19,7 @@ The `python-openevse-http` library requires you to pass an external `aiohttp.Cli import aiohttp from openevsehttp import OpenEVSE + async def main(): timeout = aiohttp.ClientTimeout(total=30) async with aiohttp.ClientSession(timeout=timeout) as session: @@ -34,6 +35,7 @@ async def main(): import aiohttp from openevsehttp import OpenEVSE + async def main(): async with aiohttp.ClientSession() as session: charger1 = OpenEVSE("charger1.local", session=session) @@ -52,6 +54,7 @@ Start websocket listening from the same event loop that owns the import aiohttp from openevsehttp import OpenEVSE + async def main(): async with aiohttp.ClientSession() as session: charger = OpenEVSE("openevse.local", session=session) diff --git a/README.md b/README.md index 2ddbc84..05d4057 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ import asyncio import aiohttp from openevsehttp import OpenEVSE + async def main(): async with aiohttp.ClientSession() as session: charger = OpenEVSE("192.168.1.30", session=session) @@ -48,6 +49,7 @@ async def main(): await charger.toggle_shaper() await charger.ws_disconnect() + if __name__ == "__main__": asyncio.run(main()) ```