diff --git a/.github/settings.yml b/.github/settings.yml index dddea1d..affefc5 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -3,10 +3,10 @@ repository: # A short description of the repository that will show up on GitHub - description: "Python package for Intex Spa wifi client" + description: "Python client for Intex Spa wifi interface" # A URL with more information about the repository - homepage: https://pypi.org/project/intex-spa/ + homepage: https://pypi.org/project/aio-intex-spa/ # A comma-separated list of topics to set on the repository topics: intex, spa, purespa, intexspa, wifi, asyncio diff --git a/README.md b/README.md index f84e3f3..fbc0b4e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# intex-spa +# aio-intex-spa @@ -8,7 +8,7 @@ -_An AsyncIO-compatible Intex Spa wifi client_ +_An AsyncIO-compatible Python client for Intex Spa wifi interface_ ## Description @@ -23,7 +23,7 @@ It is written with asyncio network functions. It only supports asyncio usage. ## User installation ```bash -python3 -m pip install -U intex-spa +python3 -m pip install -U aio-intex-spa ``` ## Usage examples @@ -32,24 +32,24 @@ Below are some examples, see `examples` directory for more delight. ### Retrieve spa status ```python -from intex_spa import IntexSpa +from aio_intex_spa import IntexSpa -async def use_intex_spa(): - intex_spa = IntexSpa(SPA_ADDRESS) - await intex_spa.async_update_status() +async def get_spa_status(): + spa = IntexSpa(SPA_ADDRESS) + await spa.async_update_status() -asyncio.run(use_intex_spa()) +asyncio.run(get_spa_status()) ``` -### Set spa function state +### Set spa heater state ```python -from intex_spa import IntexSpa +from aio_intex_spa import IntexSpa -async def use_intex_spa(): - intex_spa = IntexSpa(SPA_ADDRESS) - await intex_spa.async_set_heater(True) +async def set_spa_heater_state(): + spa = IntexSpa(SPA_ADDRESS) + await spa.async_set_heater(True) -asyncio.run(use_intex_spa()) +asyncio.run(set_spa_heater_state()) ``` ## Versioning @@ -62,11 +62,11 @@ For Changelog, please read [releases]. -[pypilink]: https://pypi.org/project/intex-spa/ -[pypibadge]: https://badge.fury.io/py/intex-spa.svg -[releases]: https://github.com/mathieu-mp/intex-spa/releases +[pypilink]: https://pypi.org/project/aio-intex-spa/ +[pypibadge]: https://badge.fury.io/py/aio-intex-spa.svg +[releases]: https://github.com/mathieu-mp/aio-intex-spa/releases [maintenance-shield]: https://img.shields.io/maintenance/yes/2023.svg -[devcontainer]: https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/mathieu-mp/intex-spa +[devcontainer]: https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/mathieu-mp/aio-intex-spa [devcontainer-badge]: https://img.shields.io/static/v1?label=Remote%20-%20Containers&message=Open&color=blue&logo=visualstudiocode \ No newline at end of file diff --git a/aio_intex_spa/__init__.py b/aio_intex_spa/__init__.py new file mode 100644 index 0000000..9798258 --- /dev/null +++ b/aio_intex_spa/__init__.py @@ -0,0 +1,7 @@ +"""Initialize the package.""" + +from aio_intex_spa.intex_spa import IntexSpa +from aio_intex_spa.intex_spa_exceptions import ( + IntexSpaUnreachableException, + IntexSpaDnsException, +) diff --git a/intex_spa/intex_spa.py b/aio_intex_spa/intex_spa.py similarity index 99% rename from intex_spa/intex_spa.py rename to aio_intex_spa/intex_spa.py index fc3c9d2..339744f 100644 --- a/intex_spa/intex_spa.py +++ b/aio_intex_spa/intex_spa.py @@ -146,7 +146,7 @@ async def _async_handle_intent( raise IntexSpaUnreachableException("Spa is unreachable") # Return a status even when getattr(self.status, intent) == expected_state - # Fixes mathieu-mp/intex-spa#17 + # Fixes mathieu-mp/aio-intex-spa#17 return self.status async def async_update_status(self) -> IntexSpaStatus: diff --git a/intex_spa/intex_spa_exceptions.py b/aio_intex_spa/intex_spa_exceptions.py similarity index 100% rename from intex_spa/intex_spa_exceptions.py rename to aio_intex_spa/intex_spa_exceptions.py diff --git a/intex_spa/intex_spa_network_layer.py b/aio_intex_spa/intex_spa_network_layer.py similarity index 100% rename from intex_spa/intex_spa_network_layer.py rename to aio_intex_spa/intex_spa_network_layer.py diff --git a/intex_spa/intex_spa_object_info.py b/aio_intex_spa/intex_spa_object_info.py similarity index 92% rename from intex_spa/intex_spa_object_info.py rename to aio_intex_spa/intex_spa_object_info.py index eee7d08..48f39e7 100644 --- a/intex_spa/intex_spa_object_info.py +++ b/aio_intex_spa/intex_spa_object_info.py @@ -6,7 +6,7 @@ class IntexSpaInfo: """ - Class to represent Intex Spa status + Class to represent Intex Spa info Attributes ------- @@ -20,7 +20,7 @@ class IntexSpaInfo: def __init__(self, raw_info: str = None): """ - Initialize IntexSpaStatus class + Initialize IntexSpaInfo class Parameters ---------- @@ -69,6 +69,6 @@ def as_dict(self) -> dict: def __repr__(self) -> str: """ - Represent IntexSpaInfo main status attributes + Represent IntexSpaInfo main attributes """ return repr(self.as_dict()) diff --git a/intex_spa/intex_spa_object_status.py b/aio_intex_spa/intex_spa_object_status.py similarity index 98% rename from intex_spa/intex_spa_object_status.py rename to aio_intex_spa/intex_spa_object_status.py index d2caf5e..49c90c4 100644 --- a/intex_spa/intex_spa_object_status.py +++ b/aio_intex_spa/intex_spa_object_status.py @@ -158,6 +158,6 @@ def as_dict(self) -> dict: def __repr__(self) -> str: """ - Represent IntexSpaStatus main status attributes + Represent IntexSpaStatus main attributes """ return repr(self.as_dict()) diff --git a/intex_spa/intex_spa_query.py b/aio_intex_spa/intex_spa_query.py similarity index 98% rename from intex_spa/intex_spa_query.py rename to aio_intex_spa/intex_spa_query.py index 9c7c27e..ff44238 100644 --- a/intex_spa/intex_spa_query.py +++ b/aio_intex_spa/intex_spa_query.py @@ -56,7 +56,7 @@ def checksum_as_int(data: str) -> int: int("0x" + data[index : index + 2], 16) ) calculated_checksum = calculated_checksum % 0xFF - # Fix: https://github.com/mathieu-mp/intex-spa/issues/27 + # Fix: https://github.com/mathieu-mp/aio-intex-spa/issues/27 if calculated_checksum == 0x00: calculated_checksum = 0xFF return calculated_checksum diff --git a/examples/intex_spa_get_info.py b/examples/intex_spa_get_info.py index 9801bb4..2f07ff4 100644 --- a/examples/intex_spa_get_info.py +++ b/examples/intex_spa_get_info.py @@ -1,20 +1,20 @@ -"""Usage example file""" +"""Usage example: Get spa info""" import os import logging import asyncio -from intex_spa.intex_spa import IntexSpa +from aio_intex_spa import IntexSpa SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" logging.basicConfig(level=logging.DEBUG) -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) +async def get_spa_info(): + """Get spa info""" + spa = IntexSpa(SPA_ADDRESS) - print(await intex_spa.async_update_info()) + print(await spa.async_update_info()) -asyncio.run(example_intex_spa()) +asyncio.run(get_spa_info()) diff --git a/examples/intex_spa_get_status.py b/examples/intex_spa_get_status.py index 534ad19..cdda18e 100644 --- a/examples/intex_spa_get_status.py +++ b/examples/intex_spa_get_status.py @@ -1,20 +1,20 @@ -"""Usage example file""" +"""Usage example: Get spa status""" import os import logging import asyncio -from intex_spa.intex_spa import IntexSpa +from aio_intex_spa import IntexSpa SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" logging.basicConfig(level=logging.DEBUG) -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) +async def get_spa_status(): + """Get spa status""" + spa = IntexSpa(SPA_ADDRESS) - print(await intex_spa.async_update_status()) + print(await spa.async_update_status()) -asyncio.run(example_intex_spa()) +asyncio.run(get_spa_status()) diff --git a/examples/intex_spa_get_status_double.py b/examples/intex_spa_get_status_double.py deleted file mode 100644 index 457069a..0000000 --- a/examples/intex_spa_get_status_double.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Usage example file""" -import os -import logging -import asyncio - -from intex_spa.intex_spa import IntexSpa - -SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" - -logging.basicConfig(level=logging.DEBUG) - - -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) - - print(await intex_spa.async_update_status()) - print(await intex_spa.async_update_status()) - - -asyncio.run(example_intex_spa()) diff --git a/examples/intex_spa_get_status_twice.py b/examples/intex_spa_get_status_twice.py new file mode 100644 index 0000000..19d1b74 --- /dev/null +++ b/examples/intex_spa_get_status_twice.py @@ -0,0 +1,21 @@ +"""Usage example: Get spa status twice""" +import os +import logging +import asyncio + +from aio_intex_spa import IntexSpa + +SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" + +logging.basicConfig(level=logging.DEBUG) + + +async def get_spa_status_twice(): + """Get spa status twice""" + spa = IntexSpa(SPA_ADDRESS) + + print(await spa.async_update_status()) + print(await spa.async_update_status()) + + +asyncio.run(get_spa_status_twice()) diff --git a/examples/intex_spa_get_status_with_delay.py b/examples/intex_spa_get_status_with_delay.py index be24ab5..6db003d 100644 --- a/examples/intex_spa_get_status_with_delay.py +++ b/examples/intex_spa_get_status_with_delay.py @@ -1,22 +1,22 @@ -"""Usage example file""" +"""Usage example: Get spa status with delay""" import os import logging import asyncio -from intex_spa.intex_spa import IntexSpa +from aio_intex_spa import IntexSpa SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" logging.basicConfig(level=logging.DEBUG) -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) +async def get_spa_status_with_delay(): + """Get spa status with delay""" + spa = IntexSpa(SPA_ADDRESS) - print(await intex_spa.async_update_status()) + print(await spa.async_update_status()) await asyncio.sleep(10) - print(await intex_spa.async_update_status()) + print(await spa.async_update_status()) -asyncio.run(example_intex_spa()) +asyncio.run(get_spa_status_with_delay()) diff --git a/examples/intex_spa_set_bubbles_off.py b/examples/intex_spa_set_bubbles_off.py index 1241636..d8ac618 100644 --- a/examples/intex_spa_set_bubbles_off.py +++ b/examples/intex_spa_set_bubbles_off.py @@ -1,20 +1,20 @@ -"""Usage example file""" +"""Usage example: Set spa bubbles off""" import os import logging import asyncio -from intex_spa.intex_spa import IntexSpa +from aio_intex_spa import IntexSpa SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" logging.basicConfig(level=logging.DEBUG) -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) +async def set_spa_bubbles_off(): + """Set spa bubbles off""" + spa = IntexSpa(SPA_ADDRESS) - print(await intex_spa.async_set_bubbles(False)) + print(await spa.async_set_bubbles(False)) -asyncio.run(example_intex_spa()) +asyncio.run(set_spa_bubbles_off()) diff --git a/examples/intex_spa_set_bubbles_on.py b/examples/intex_spa_set_bubbles_on.py index fda062a..5bc9b31 100644 --- a/examples/intex_spa_set_bubbles_on.py +++ b/examples/intex_spa_set_bubbles_on.py @@ -1,20 +1,20 @@ -"""Usage example file""" +"""Usage example: Set spa bubbles on""" import os import logging import asyncio -from intex_spa.intex_spa import IntexSpa +from aio_intex_spa import IntexSpa SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" logging.basicConfig(level=logging.DEBUG) -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) +async def set_spa_bubbles_on(): + """Set spa bubbles on""" + spa = IntexSpa(SPA_ADDRESS) - print(await intex_spa.async_set_bubbles()) + print(await spa.async_set_bubbles()) -asyncio.run(example_intex_spa()) +asyncio.run(set_spa_bubbles_on()) diff --git a/examples/intex_spa_set_filter_off.py b/examples/intex_spa_set_filter_off.py index a4c2117..75a29db 100644 --- a/examples/intex_spa_set_filter_off.py +++ b/examples/intex_spa_set_filter_off.py @@ -1,20 +1,20 @@ -"""Usage example file""" +"""Usage example: Set spa filter off""" import os import logging import asyncio -from intex_spa.intex_spa import IntexSpa +from aio_intex_spa import IntexSpa SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" logging.basicConfig(level=logging.DEBUG) -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) +async def set_spa_filter_off(): + """Set spa filter off""" + spa = IntexSpa(SPA_ADDRESS) - print(await intex_spa.async_set_filter(False)) + print(await spa.async_set_filter(False)) -asyncio.run(example_intex_spa()) +asyncio.run(set_spa_filter_off()) diff --git a/examples/intex_spa_set_filter_on.py b/examples/intex_spa_set_filter_on.py index 1ceddcc..2f95abd 100644 --- a/examples/intex_spa_set_filter_on.py +++ b/examples/intex_spa_set_filter_on.py @@ -1,20 +1,20 @@ -"""Usage example file""" +"""Usage example: Set spa filter on""" import os import logging import asyncio -from intex_spa.intex_spa import IntexSpa +from aio_intex_spa import IntexSpa SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" logging.basicConfig(level=logging.DEBUG) -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) +async def set_spa_filter_on(): + """Set spa filter on""" + spa = IntexSpa(SPA_ADDRESS) - print(await intex_spa.async_set_filter()) + print(await spa.async_set_filter()) -asyncio.run(example_intex_spa()) +asyncio.run(set_spa_filter_on()) diff --git a/examples/intex_spa_set_heater_off.py b/examples/intex_spa_set_heater_off.py index ecf53a2..a8882d8 100644 --- a/examples/intex_spa_set_heater_off.py +++ b/examples/intex_spa_set_heater_off.py @@ -1,20 +1,20 @@ -"""Usage example file""" +"""Usage example: Set spa heater off""" import os import logging import asyncio -from intex_spa.intex_spa import IntexSpa +from aio_intex_spa import IntexSpa SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" logging.basicConfig(level=logging.DEBUG) -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) +async def set_spa_heater_off(): + """Set spa heater off""" + spa = IntexSpa(SPA_ADDRESS) - print(await intex_spa.async_set_heater(False)) + print(await spa.async_set_heater(False)) -asyncio.run(example_intex_spa()) +asyncio.run(set_spa_heater_off()) diff --git a/examples/intex_spa_set_heater_on.py b/examples/intex_spa_set_heater_on.py index 45a935f..9020b60 100644 --- a/examples/intex_spa_set_heater_on.py +++ b/examples/intex_spa_set_heater_on.py @@ -1,20 +1,20 @@ -"""Usage example file""" +"""Usage example: Set spa heater on""" import os import logging import asyncio -from intex_spa.intex_spa import IntexSpa +from aio_intex_spa import IntexSpa SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" logging.basicConfig(level=logging.DEBUG) -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) +async def set_spa_heater_on(): + """Set spa heater on""" + spa = IntexSpa(SPA_ADDRESS) - print(await intex_spa.async_set_heater()) + print(await spa.async_set_heater()) -asyncio.run(example_intex_spa()) +asyncio.run(set_spa_heater_on()) diff --git a/examples/intex_spa_set_jets_off.py b/examples/intex_spa_set_jets_off.py index 3bae5cb..d8678eb 100644 --- a/examples/intex_spa_set_jets_off.py +++ b/examples/intex_spa_set_jets_off.py @@ -1,20 +1,20 @@ -"""Usage example file""" +"""Usage example: Set spa jets off""" import os import logging import asyncio -from intex_spa.intex_spa import IntexSpa +from aio_intex_spa import IntexSpa SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" logging.basicConfig(level=logging.DEBUG) -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) +async def set_spa_jets_off(): + """Set spa jets off""" + spa = IntexSpa(SPA_ADDRESS) - print(await intex_spa.async_set_jets(False)) + print(await spa.async_set_jets(False)) -asyncio.run(example_intex_spa()) +asyncio.run(set_spa_jets_off()) diff --git a/examples/intex_spa_set_jets_on.py b/examples/intex_spa_set_jets_on.py index 9c232a5..05bb954 100644 --- a/examples/intex_spa_set_jets_on.py +++ b/examples/intex_spa_set_jets_on.py @@ -1,20 +1,20 @@ -"""Usage example file""" +"""Usage example: Set spa jets on""" import os import logging import asyncio -from intex_spa.intex_spa import IntexSpa +from aio_intex_spa import IntexSpa SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" logging.basicConfig(level=logging.DEBUG) -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) +async def set_spa_jets_on(): + """Set spa jets on""" + spa = IntexSpa(SPA_ADDRESS) - print(await intex_spa.async_set_jets()) + print(await spa.async_set_jets()) -asyncio.run(example_intex_spa()) +asyncio.run(set_spa_jets_on()) diff --git a/examples/intex_spa_set_power_off.py b/examples/intex_spa_set_power_off.py index ffce21e..35ca698 100644 --- a/examples/intex_spa_set_power_off.py +++ b/examples/intex_spa_set_power_off.py @@ -1,20 +1,20 @@ -"""Usage example file""" +"""Usage example: Set spa power off""" import os import logging import asyncio -from intex_spa.intex_spa import IntexSpa +from aio_intex_spa import IntexSpa SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" logging.basicConfig(level=logging.DEBUG) -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) +async def set_spa_power_off(): + """Set spa power off""" + spa = IntexSpa(SPA_ADDRESS) - print(await intex_spa.async_set_power(False)) + print(await spa.async_set_power(False)) -asyncio.run(example_intex_spa()) +asyncio.run(set_spa_power_off()) diff --git a/examples/intex_spa_set_power_on.py b/examples/intex_spa_set_power_on.py index fd76316..2abd2db 100644 --- a/examples/intex_spa_set_power_on.py +++ b/examples/intex_spa_set_power_on.py @@ -1,20 +1,20 @@ -"""Usage example file""" +"""Usage example: Set spa power on""" import os import logging import asyncio -from intex_spa.intex_spa import IntexSpa +from aio_intex_spa import IntexSpa SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" logging.basicConfig(level=logging.DEBUG) -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) +async def set_spa_power_on(): + """Set spa power on""" + spa = IntexSpa(SPA_ADDRESS) - print(await intex_spa.async_set_power()) + print(await spa.async_set_power()) -asyncio.run(example_intex_spa()) +asyncio.run(set_spa_power_on()) diff --git a/examples/intex_spa_set_preset_temp_25.py b/examples/intex_spa_set_preset_temp_25.py index 4205c86..93a19c3 100644 --- a/examples/intex_spa_set_preset_temp_25.py +++ b/examples/intex_spa_set_preset_temp_25.py @@ -1,20 +1,20 @@ -"""Usage example file""" +"""Usage example: Set spa preset temp to 25°C""" import os import logging import asyncio -from intex_spa.intex_spa import IntexSpa +from aio_intex_spa import IntexSpa SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" logging.basicConfig(level=logging.DEBUG) -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) +async def set_spa_preset_temp_25(): + """Set spa preset temp to 25°C""" + spa = IntexSpa(SPA_ADDRESS) - print(await intex_spa.async_set_preset_temp(25)) + print(await spa.async_set_preset_temp(25)) -asyncio.run(example_intex_spa()) +asyncio.run(set_spa_preset_temp_25()) diff --git a/examples/intex_spa_set_preset_temp_34.py b/examples/intex_spa_set_preset_temp_34.py index 742e33f..19f9a50 100644 --- a/examples/intex_spa_set_preset_temp_34.py +++ b/examples/intex_spa_set_preset_temp_34.py @@ -1,20 +1,20 @@ -"""Usage example file""" +"""Usage example: Set spa preset temp to 34°C""" import os import logging import asyncio -from intex_spa.intex_spa import IntexSpa +from aio_intex_spa import IntexSpa SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" logging.basicConfig(level=logging.DEBUG) -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) +async def set_spa_preset_temp_34(): + """Set spa preset temp to 34°C""" + spa = IntexSpa(SPA_ADDRESS) - print(await intex_spa.async_set_preset_temp(34)) + print(await spa.async_set_preset_temp(34)) -asyncio.run(example_intex_spa()) +asyncio.run(set_spa_preset_temp_34()) diff --git a/examples/intex_spa_set_sanitizer_off.py b/examples/intex_spa_set_sanitizer_off.py index 8fe6a27..b51218b 100644 --- a/examples/intex_spa_set_sanitizer_off.py +++ b/examples/intex_spa_set_sanitizer_off.py @@ -1,20 +1,20 @@ -"""Usage example file""" +"""Usage example: Set spa sanitizer off""" import os import logging import asyncio -from intex_spa.intex_spa import IntexSpa +from aio_intex_spa import IntexSpa SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" logging.basicConfig(level=logging.DEBUG) -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) +async def set_spa_sanitizer_off(): + """Set spa sanitizer off""" + spa = IntexSpa(SPA_ADDRESS) - print(await intex_spa.async_set_sanitizer(False)) + print(await spa.async_set_sanitizer(False)) -asyncio.run(example_intex_spa()) +asyncio.run(set_spa_sanitizer_off()) diff --git a/examples/intex_spa_set_sanitizer_on.py b/examples/intex_spa_set_sanitizer_on.py index 12f7f8b..a0eaf32 100644 --- a/examples/intex_spa_set_sanitizer_on.py +++ b/examples/intex_spa_set_sanitizer_on.py @@ -1,20 +1,20 @@ -"""Usage example file""" +"""Usage example: Set spa sanitizer on""" import os import logging import asyncio -from intex_spa.intex_spa import IntexSpa +from aio_intex_spa import IntexSpa SPA_ADDRESS = os.getenv("SPA_ADDRESS") or "SPA_DEVICE" logging.basicConfig(level=logging.DEBUG) -async def example_intex_spa(): - """Example for intex_spa""" - intex_spa = IntexSpa(SPA_ADDRESS) +async def set_spa_sanitizer_on(): + """Set spa sanitizer on""" + spa = IntexSpa(SPA_ADDRESS) - print(await intex_spa.async_set_sanitizer()) + print(await spa.async_set_sanitizer()) -asyncio.run(example_intex_spa()) +asyncio.run(set_spa_sanitizer_on()) diff --git a/intex_spa/__init__.py b/intex_spa/__init__.py deleted file mode 100644 index ffdf5c6..0000000 --- a/intex_spa/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Initialize the package.""" - -from intex_spa.intex_spa import IntexSpa -from intex_spa.intex_spa_exceptions import ( - IntexSpaUnreachableException, - IntexSpaDnsException, -) diff --git a/setup.py b/setup.py index 3f9a247..317e798 100644 --- a/setup.py +++ b/setup.py @@ -5,14 +5,14 @@ with open("README.md", "r") as fh: README = fh.read() setup( - name="intex-spa", + name="aio-intex-spa", version="0.0.0", author="Mathieu Payrol", - author_email="intex-spa@payrol.fr", - description="Intex Spa wifi client", + author_email="aio-intex-spa@payrol.fr", + description="Python client for Intex Spa wifi interface", long_description=README, long_description_content_type="text/markdown", - url="https://github.com/mathieu-mp/intex-spa", + url="https://github.com/mathieu-mp/aio-intex-spa", packages=find_packages(), install_requires=[], classifiers=( diff --git a/tests/test_intex_spa_query_checksum.py b/tests/test_intex_spa_query_checksum.py index 02c21be..b7338d1 100644 --- a/tests/test_intex_spa_query_checksum.py +++ b/tests/test_intex_spa_query_checksum.py @@ -1,11 +1,11 @@ -from intex_spa.intex_spa_query import IntexSpaQuery +from aio_intex_spa.intex_spa_query import IntexSpaQuery import pytest valid_status_responses = [ b'{"sid":"12345678901234","data":"FFFF110F010700220000000080808022000012","result":"ok","type":2}\n', - b'{"sid":"12345678901234","data":"FFFF110F01070064000000008080806700008A","result":"ok","type":2}\n', # From https://github.com/mathieu-mp/intex-spa/issues/27 - b'{"sid":"12345678901234","data":"FFFF110F0107006400000085808085670000FF","result":"ok","type":2}\n', # From https://github.com/mathieu-mp/intex-spa/issues/27 + b'{"sid":"12345678901234","data":"FFFF110F01070064000000008080806700008A","result":"ok","type":2}\n', # From https://github.com/mathieu-mp/aio-intex-spa/issues/27 + b'{"sid":"12345678901234","data":"FFFF110F0107006400000085808085670000FF","result":"ok","type":2}\n', # From https://github.com/mathieu-mp/aio-intex-spa/issues/27 ] invalid_status_responses = [ b'{"sid":"12345678901234","data":"FFFF110F010700220000000080808022000044","result":"ok","type":2}\n', # Arbitrary false checksum diff --git a/tests/test_intex_spa_status.py b/tests/test_intex_spa_status.py index 8a8eeea..8890d78 100644 --- a/tests/test_intex_spa_status.py +++ b/tests/test_intex_spa_status.py @@ -1,4 +1,4 @@ -from intex_spa.intex_spa_object_status import IntexSpaStatus +from aio_intex_spa.intex_spa_object_status import IntexSpaStatus def test_intex_spa_status():