From 8c15f5ee51d48cc7ae179024db8385609ceccdc2 Mon Sep 17 00:00:00 2001 From: Ludovic Ortega Date: Thu, 16 Nov 2023 23:36:07 +0100 Subject: [PATCH] feat: use ruff, minor code change and fix documentation --- .github/workflows/test.yml | 5 +- README.md | 4 +- awtrix_light_client/http_client.py | 39 ++++----- poetry.lock | 131 +++++++---------------------- pyproject.toml | 8 +- tests/test_http_client.py | 40 ++++----- 6 files changed, 77 insertions(+), 150 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1a6eb5f..a4dfb2b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,11 +32,12 @@ jobs: run: | export PATH="$PATH:$HOME/.local/bin" poetry install --with=dev - - name: Run pre-commit + - name: Run ruff run: | export PATH="$PATH:$HOME/.local/bin" source `poetry env info --path`/bin/activate - poetry run black . + poetry run ruff format --check . + poetry run ruff check . - name: Run test run: | export PATH="$PATH:$HOME/.local/bin" diff --git a/README.md b/README.md index 624127b..e3e52f2 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Python async HTTP client for [awtrix-light](https://github.com/Blueforcer/awtrix [![PyPI](https://img.shields.io/pypi/v/awtrix-light-client.svg)](https://pypi.python.org/pypi/awtrix-light-client) [![PyPI versions](https://img.shields.io/pypi/pyversions/awtrix-light-client.svg)](https://pypi.python.org/pypi/awtrix-light-client) [![Python test](https://github.com/M0NsTeRRR/awtrix-light-client/actions/workflows/test.yml/badge.svg)](https://github.com/M0NsTeRRR/awtrix-light-client/actions/workflows/test.yml) -[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black) +[![Code Style](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff) # Warning This client has been tested with awtrix-light v0.90 use with caution as official dev documentation is not fully documented and can cause crash @@ -36,7 +36,7 @@ AWTRIX_HTTP_CLIENT_AWTRIX="" "base_url": "http://192.168.0.1", "username": "admin", "password": "password", - "verify_ssl": false, + "verify_ssl": false } ``` `verify_ssl` used to verify https config (if accessing behind an HTTPS reverse proxy), can be `true`, `false`, or can point to a local ca bundle PEM encoded to validate local CA diff --git a/awtrix_light_client/http_client.py b/awtrix_light_client/http_client.py index 71c75ed..10ae1d3 100644 --- a/awtrix_light_client/http_client.py +++ b/awtrix_light_client/http_client.py @@ -35,11 +35,8 @@ async def _make_request( url: str, params: Dict[Any, Any] = None, data: Dict[Any, Any] = None, - json_data: Dict[Any, Any] = None, ): - r = await self._client.request( - method, url, params=params, data=data, json=json_data - ) + r = await self._client.request(method, url, params=params, json=data) if not r.is_success: raise AwtrixLightHttpClientError( @@ -93,25 +90,25 @@ async def set_power(self, power: bool) -> None: """ Toggle the matrix on or off """ - await self._make_request("POST", "power", json_data={"power": power}) + await self._make_request("POST", "power", data={"power": power}) async def set_sleep(self, seconds: int) -> None: """ Send the board in deep sleep mode (turns off the matrix as well), good for saving battery life """ - await self._make_request("POST", "sleep", json_data={"sleep": seconds}) + await self._make_request("POST", "sleep", data={"sleep": seconds}) async def set_sound(self, sound: str) -> None: """ Play a RTTTL sound from the MELODIES folder """ - await self._make_request("POST", "sound", json_data={"sound": sound}) + await self._make_request("POST", "sound", data={"sound": sound}) async def set_rtttl(self, rtttl: str) -> None: """ Play a RTTTL sound from a given RTTTL string """ - await self._make_request("POST", "rtttl", json_data={"rtttl": rtttl}) + await self._make_request("POST", "rtttl", data={"rtttl": rtttl}) async def set_moodlight(self, moodlight: Moodlight) -> None: """ @@ -119,7 +116,7 @@ async def set_moodlight(self, moodlight: Moodlight) -> None: To disable moodlight pass `Moodlight()` """ await self._make_request( - "POST", "moodlight", json_data=moodlight.model_dump(exclude_none=True) + "POST", "moodlight", data=moodlight.model_dump(exclude_none=True) ) async def set_indicator( @@ -141,18 +138,18 @@ async def set_indicator( if blink and fade: raise ValueError("fade and blink can't be set together") - json_data = {"color": as_hex(color, format="long").upper()} + data = {"color": as_hex(color, format="long").upper()} if blink: - json_data["blink"] = blink + data["blink"] = blink if fade: - json_data["fade"] = fade + data["fade"] = fade await self._make_request( "POST", f"indicator{indicator}", - json_data=json_data, + data=data, ) async def set_custom_application( @@ -167,22 +164,18 @@ async def set_custom_application( To eradicate a single app, direct the command to, for instance, test1 """ if isinstance(custom_application, CustomApplication): - json_data = custom_application.model_dump(exclude_none=True) + data = custom_application.model_dump(exclude_none=True) else: - json_data = [ - app.model_dump(exclude_none=True) for app in custom_application - ] + data = [app.model_dump(exclude_none=True) for app in custom_application] - await self._make_request( - "POST", "custom", params={"name": name}, json_data=json_data - ) + await self._make_request("POST", "custom", params={"name": name}, data=data) async def notify(self, notification: Notification) -> None: """ One-Time Notification """ await self._make_request( - "POST", "notify", json_data=notification.model_dump(exclude_none=True) + "POST", "notify", data=notification.model_dump(exclude_none=True) ) async def dismiss_notification(self) -> None: @@ -207,7 +200,7 @@ async def switch_app(self, name: str) -> None: """ Directly transition to a desired app using its name """ - await self._make_request("POST", "switch", json_data={"name": name}) + await self._make_request("POST", "switch", data={"name": name}) async def get_settings(self) -> Settings: """ @@ -220,7 +213,7 @@ async def set_settings(self, s: Settings) -> None: You can initiate the firmware update either through the update button in HA or using the following """ await self._make_request( - "POST", "settings", json_data=s.model_dump(exclude_none=True) + "POST", "settings", data=s.model_dump(exclude_none=True) ) async def update(self) -> None: diff --git a/poetry.lock b/poetry.lock index 77e2a42..f7c6dc2 100644 --- a/poetry.lock +++ b/poetry.lock @@ -32,48 +32,6 @@ doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)"] test = ["anyio[trio]", "coverage[toml] (>=7)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] trio = ["trio (>=0.22)"] -[[package]] -name = "black" -version = "23.11.0" -description = "The uncompromising code formatter." -optional = false -python-versions = ">=3.8" -files = [ - {file = "black-23.11.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dbea0bb8575c6b6303cc65017b46351dc5953eea5c0a59d7b7e3a2d2f433a911"}, - {file = "black-23.11.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:412f56bab20ac85927f3a959230331de5614aecda1ede14b373083f62ec24e6f"}, - {file = "black-23.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d136ef5b418c81660ad847efe0e55c58c8208b77a57a28a503a5f345ccf01394"}, - {file = "black-23.11.0-cp310-cp310-win_amd64.whl", hash = "sha256:6c1cac07e64433f646a9a838cdc00c9768b3c362805afc3fce341af0e6a9ae9f"}, - {file = "black-23.11.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cf57719e581cfd48c4efe28543fea3d139c6b6f1238b3f0102a9c73992cbb479"}, - {file = "black-23.11.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:698c1e0d5c43354ec5d6f4d914d0d553a9ada56c85415700b81dc90125aac244"}, - {file = "black-23.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:760415ccc20f9e8747084169110ef75d545f3b0932ee21368f63ac0fee86b221"}, - {file = "black-23.11.0-cp311-cp311-win_amd64.whl", hash = "sha256:58e5f4d08a205b11800332920e285bd25e1a75c54953e05502052738fe16b3b5"}, - {file = "black-23.11.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:45aa1d4675964946e53ab81aeec7a37613c1cb71647b5394779e6efb79d6d187"}, - {file = "black-23.11.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4c44b7211a3a0570cc097e81135faa5f261264f4dfaa22bd5ee2875a4e773bd6"}, - {file = "black-23.11.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2a9acad1451632021ee0d146c8765782a0c3846e0e0ea46659d7c4f89d9b212b"}, - {file = "black-23.11.0-cp38-cp38-win_amd64.whl", hash = "sha256:fc7f6a44d52747e65a02558e1d807c82df1d66ffa80a601862040a43ec2e3142"}, - {file = "black-23.11.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7f622b6822f02bfaf2a5cd31fdb7cd86fcf33dab6ced5185c35f5db98260b055"}, - {file = "black-23.11.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:250d7e60f323fcfc8ea6c800d5eba12f7967400eb6c2d21ae85ad31c204fb1f4"}, - {file = "black-23.11.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5133f5507007ba08d8b7b263c7aa0f931af5ba88a29beacc4b2dc23fcefe9c06"}, - {file = "black-23.11.0-cp39-cp39-win_amd64.whl", hash = "sha256:421f3e44aa67138ab1b9bfbc22ee3780b22fa5b291e4db8ab7eee95200726b07"}, - {file = "black-23.11.0-py3-none-any.whl", hash = "sha256:54caaa703227c6e0c87b76326d0862184729a69b73d3b7305b6288e1d830067e"}, - {file = "black-23.11.0.tar.gz", hash = "sha256:4c68855825ff432d197229846f971bc4d6666ce90492e5b02013bcaca4d9ab05"}, -] - -[package.dependencies] -click = ">=8.0.0" -mypy-extensions = ">=0.4.3" -packaging = ">=22.0" -pathspec = ">=0.9.0" -platformdirs = ">=2" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} - -[package.extras] -colorama = ["colorama (>=0.4.3)"] -d = ["aiohttp (>=3.7.4)"] -jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] -uvloop = ["uvloop (>=0.15.2)"] - [[package]] name = "certifi" version = "2023.7.22" @@ -85,20 +43,6 @@ files = [ {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, ] -[[package]] -name = "click" -version = "8.1.7" -description = "Composable command line interface toolkit" -optional = false -python-versions = ">=3.7" -files = [ - {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, - {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, -] - -[package.dependencies] -colorama = {version = "*", markers = "platform_system == \"Windows\""} - [[package]] name = "colorama" version = "0.4.6" @@ -204,24 +148,24 @@ files = [ [[package]] name = "httpcore" -version = "0.18.0" +version = "1.0.2" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" files = [ - {file = "httpcore-0.18.0-py3-none-any.whl", hash = "sha256:adc5398ee0a476567bf87467063ee63584a8bce86078bf748e48754f60202ced"}, - {file = "httpcore-0.18.0.tar.gz", hash = "sha256:13b5e5cd1dca1a6636a6aaea212b19f4f85cd88c366a2b82304181b769aab3c9"}, + {file = "httpcore-1.0.2-py3-none-any.whl", hash = "sha256:096cc05bca73b8e459a1fc3dcf585148f63e534eae4339559c9b8a8d6399acc7"}, + {file = "httpcore-1.0.2.tar.gz", hash = "sha256:9fc092e4799b26174648e54b74ed5f683132a464e95643b226e00c2ed2fa6535"}, ] [package.dependencies] -anyio = ">=3.0,<5.0" certifi = "*" h11 = ">=0.13,<0.15" -sniffio = "==1.*" [package.extras] +asyncio = ["anyio (>=4.0,<5.0)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] +trio = ["trio (>=0.22.0,<0.23.0)"] [[package]] name = "httpx" @@ -269,17 +213,6 @@ files = [ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] -[[package]] -name = "mypy-extensions" -version = "1.0.0" -description = "Type system extensions for programs checked with the mypy type checker." -optional = false -python-versions = ">=3.5" -files = [ - {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, - {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, -] - [[package]] name = "packaging" version = "23.2" @@ -291,32 +224,6 @@ files = [ {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, ] -[[package]] -name = "pathspec" -version = "0.11.2" -description = "Utility library for gitignore style pattern matching of file paths." -optional = false -python-versions = ">=3.7" -files = [ - {file = "pathspec-0.11.2-py3-none-any.whl", hash = "sha256:1d6ed233af05e679efb96b1851550ea95bbb64b7c490b0f5aa52996c11e92a20"}, - {file = "pathspec-0.11.2.tar.gz", hash = "sha256:e0d8d0ac2f12da61956eb2306b69f9469b42f4deb0f3cb6ed47b9cce9996ced3"}, -] - -[[package]] -name = "platformdirs" -version = "3.11.0" -description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -optional = false -python-versions = ">=3.7" -files = [ - {file = "platformdirs-3.11.0-py3-none-any.whl", hash = "sha256:e9d171d00af68be50e9202731309c4e658fd8bc76f55c11c7dd760d023bda68e"}, - {file = "platformdirs-3.11.0.tar.gz", hash = "sha256:cf8ee52a3afdb965072dcc652433e0c7e3e40cf5ea1477cd4b3b1d2eb75495b3"}, -] - -[package.extras] -docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.1)", "sphinx-autodoc-typehints (>=1.24)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)"] - [[package]] name = "pluggy" version = "1.3.0" @@ -590,6 +497,32 @@ files = [ [package.extras] cli = ["click (>=5.0)"] +[[package]] +name = "ruff" +version = "0.1.5" +description = "An extremely fast Python linter and code formatter, written in Rust." +optional = false +python-versions = ">=3.7" +files = [ + {file = "ruff-0.1.5-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:32d47fc69261c21a4c48916f16ca272bf2f273eb635d91c65d5cd548bf1f3d96"}, + {file = "ruff-0.1.5-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:171276c1df6c07fa0597fb946139ced1c2978f4f0b8254f201281729981f3c17"}, + {file = "ruff-0.1.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:17ef33cd0bb7316ca65649fc748acc1406dfa4da96a3d0cde6d52f2e866c7b39"}, + {file = "ruff-0.1.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b2c205827b3f8c13b4a432e9585750b93fd907986fe1aec62b2a02cf4401eee6"}, + {file = "ruff-0.1.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bb408e3a2ad8f6881d0f2e7ad70cddb3ed9f200eb3517a91a245bbe27101d379"}, + {file = "ruff-0.1.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:f20dc5e5905ddb407060ca27267c7174f532375c08076d1a953cf7bb016f5a24"}, + {file = "ruff-0.1.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aafb9d2b671ed934998e881e2c0f5845a4295e84e719359c71c39a5363cccc91"}, + {file = "ruff-0.1.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a4894dddb476597a0ba4473d72a23151b8b3b0b5f958f2cf4d3f1c572cdb7af7"}, + {file = "ruff-0.1.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a00a7ec893f665ed60008c70fe9eeb58d210e6b4d83ec6654a9904871f982a2a"}, + {file = "ruff-0.1.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:a8c11206b47f283cbda399a654fd0178d7a389e631f19f51da15cbe631480c5b"}, + {file = "ruff-0.1.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:fa29e67b3284b9a79b1a85ee66e293a94ac6b7bb068b307a8a373c3d343aa8ec"}, + {file = "ruff-0.1.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:9b97fd6da44d6cceb188147b68db69a5741fbc736465b5cea3928fdac0bc1aeb"}, + {file = "ruff-0.1.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:721f4b9d3b4161df8dc9f09aa8562e39d14e55a4dbaa451a8e55bdc9590e20f4"}, + {file = "ruff-0.1.5-py3-none-win32.whl", hash = "sha256:f80c73bba6bc69e4fdc73b3991db0b546ce641bdcd5b07210b8ad6f64c79f1ab"}, + {file = "ruff-0.1.5-py3-none-win_amd64.whl", hash = "sha256:c21fe20ee7d76206d290a76271c1af7a5096bc4c73ab9383ed2ad35f852a0087"}, + {file = "ruff-0.1.5-py3-none-win_arm64.whl", hash = "sha256:82bfcb9927e88c1ed50f49ac6c9728dab3ea451212693fe40d08d314663e412f"}, + {file = "ruff-0.1.5.tar.gz", hash = "sha256:5cbec0ef2ae1748fb194f420fb03fb2c25c3258c86129af7172ff8f198f125ab"}, +] + [[package]] name = "sniffio" version = "1.3.0" @@ -626,4 +559,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = ">=3.9" -content-hash = "cca2719f638a67adf2c8c3b5c2f3462e2a4f926cfe2f6ed2675343b923ce3430" +content-hash = "675e4ba5b47d4d66f50141c0ce7f1a05edf7eb5068847481abd1ca527911b348" diff --git a/pyproject.toml b/pyproject.toml index d8328ce..7b96843 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,16 +26,16 @@ include = [ [tool.poetry.dependencies] python = ">=3.9" httpx = "~0.25.0" -pydantic = ">=2.4.2,<2.6.0" -pydantic-settings = ">=2.0.3,<2.2.0" +pydantic = "~2.5.1" +pydantic-settings = "~2.1.0" pydantic-extra-types = "~2.1.0" [tool.poetry.group.dev.dependencies] -black = ">=23.10.1,<23.12.0" pytest = "~7.4.3" pytest-cov = "~4.1.0" pytest-asyncio = "~0.21.1" -pytest-httpx = ">=0.26,<0.28" +pytest-httpx = "~0.27.0" +ruff = "~0.1.5" [tool.pytest.ini_options] asyncio_mode = "auto" diff --git a/tests/test_http_client.py b/tests/test_http_client.py index 8e8dd4c..408caa6 100644 --- a/tests/test_http_client.py +++ b/tests/test_http_client.py @@ -735,7 +735,7 @@ async def test_set_power( ) async with awtrix_http_client as client: - assert await client.set_power(False) == None + assert await client.set_power(False) is None async def test_set_sleep( @@ -748,7 +748,7 @@ async def test_set_sleep( ) async with awtrix_http_client as client: - assert await client.set_sleep(10) == None + assert await client.set_sleep(10) is None async def test_set_sound( @@ -761,7 +761,7 @@ async def test_set_sound( ) async with awtrix_http_client as client: - assert await client.set_sound("alarm") == None + assert await client.set_sound("alarm") is None async def test_set_rtttl( @@ -780,7 +780,7 @@ async def test_set_rtttl( await client.set_rtttl( "JingleBell:d=8,o=5,b=112:32p,a,a,4a,a,a,4a,a,c6,f.,16g,2a,a#,a#,a#.,16a#,a#,a,a.,16a,a,g,g,a,4g,4c6" ) - == None + is None ) @@ -803,7 +803,7 @@ async def test_set_moodlight( await client.set_moodlight( Moodlight(brightness=170, color=Color("#FF00FF")) ) - == None + is None ) @@ -814,7 +814,7 @@ async def test_wrong_indicator_param( async with awtrix_http_client as client: assert ( await client.set_indicator(2, color=Color("#FF00FF"), fade=2, blink=2) - == None + is None ) @@ -828,7 +828,7 @@ async def test_set_indicator( ) async with awtrix_http_client as client: - assert await client.set_indicator(2, color=Color("#FF00FF"), fade=2) == None + assert await client.set_indicator(2, color=Color("#FF00FF"), fade=2) is None async def test_set_one_custom_application( @@ -924,7 +924,7 @@ async def test_set_one_custom_application( save=True, ), ) - == None + is None ) @@ -1025,7 +1025,7 @@ async def test_set_multiple_custom_application( ) ], ) - == None + is None ) @@ -1125,7 +1125,7 @@ async def test_notify( clients=["http://test.fr"], ) ) - == None + is None ) @@ -1138,7 +1138,7 @@ async def test_dismiss_notification( ) async with awtrix_http_client as client: - assert await client.dismiss_notification() == None + assert await client.dismiss_notification() is None async def test_next_app( @@ -1150,7 +1150,7 @@ async def test_next_app( ) async with awtrix_http_client as client: - assert await client.next_app() == None + assert await client.next_app() is None async def test_previous_app( @@ -1162,7 +1162,7 @@ async def test_previous_app( ) async with awtrix_http_client as client: - assert await client.previous_app() == None + assert await client.previous_app() is None async def test_switch_app( @@ -1175,7 +1175,7 @@ async def test_switch_app( ) async with awtrix_http_client as client: - assert await client.switch_app("time") == None + assert await client.switch_app("time") is None async def test_get_settings( @@ -1277,7 +1277,7 @@ async def test_set_settings_all_params_optionnal( ) async with awtrix_http_client as client: - assert await client.notify(Notification()) == None + assert await client.notify(Notification()) is None async def test_set_settings( @@ -1370,7 +1370,7 @@ async def test_set_settings( MATP=True, ) ) - == None + is None ) @@ -1383,7 +1383,7 @@ async def test_update( ) async with awtrix_http_client as client: - assert await client.update() == None + assert await client.update() is None async def test_reboot( @@ -1395,7 +1395,7 @@ async def test_reboot( ) async with awtrix_http_client as client: - assert await client.reboot() == None + assert await client.reboot() is None async def test_erase( @@ -1407,7 +1407,7 @@ async def test_erase( ) async with awtrix_http_client as client: - assert await client.erase() == None + assert await client.erase() is None async def test_reset_settings( @@ -1419,4 +1419,4 @@ async def test_reset_settings( ) async with awtrix_http_client as client: - assert await client.reset_settings() == None + assert await client.reset_settings() is None