Skip to content

Commit

Permalink
Rename to aio-intex-spa (from intex-spa) (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieu-mp authored Mar 11, 2024
1 parent 94e469f commit 527e854
Show file tree
Hide file tree
Showing 32 changed files with 182 additions and 182 deletions.
4 changes: 2 additions & 2 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# intex-spa
# aio-intex-spa

<!-- badges start -->

Expand All @@ -8,7 +8,7 @@

<!-- badges end -->

_An AsyncIO-compatible Intex Spa wifi client_
_An AsyncIO-compatible Python client for Intex Spa wifi interface_

## Description

Expand All @@ -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
Expand All @@ -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
Expand All @@ -62,11 +62,11 @@ For Changelog, please read [releases].

<!-- links start -->

[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

<!-- links end -->
7 changes: 7 additions & 0 deletions aio_intex_spa/__init__.py
Original file line number Diff line number Diff line change
@@ -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,
)
2 changes: 1 addition & 1 deletion intex_spa/intex_spa.py → aio_intex_spa/intex_spa.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class IntexSpaInfo:
"""
Class to represent Intex Spa status
Class to represent Intex Spa info
Attributes
-------
Expand All @@ -20,7 +20,7 @@ class IntexSpaInfo:

def __init__(self, raw_info: str = None):
"""
Initialize IntexSpaStatus class
Initialize IntexSpaInfo class
Parameters
----------
Expand Down Expand Up @@ -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())
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions examples/intex_spa_get_info.py
Original file line number Diff line number Diff line change
@@ -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())
14 changes: 7 additions & 7 deletions examples/intex_spa_get_status.py
Original file line number Diff line number Diff line change
@@ -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())
21 changes: 0 additions & 21 deletions examples/intex_spa_get_status_double.py

This file was deleted.

21 changes: 21 additions & 0 deletions examples/intex_spa_get_status_twice.py
Original file line number Diff line number Diff line change
@@ -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())
16 changes: 8 additions & 8 deletions examples/intex_spa_get_status_with_delay.py
Original file line number Diff line number Diff line change
@@ -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())
14 changes: 7 additions & 7 deletions examples/intex_spa_set_bubbles_off.py
Original file line number Diff line number Diff line change
@@ -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())
14 changes: 7 additions & 7 deletions examples/intex_spa_set_bubbles_on.py
Original file line number Diff line number Diff line change
@@ -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())
14 changes: 7 additions & 7 deletions examples/intex_spa_set_filter_off.py
Original file line number Diff line number Diff line change
@@ -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())
14 changes: 7 additions & 7 deletions examples/intex_spa_set_filter_on.py
Original file line number Diff line number Diff line change
@@ -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())
Loading

0 comments on commit 527e854

Please sign in to comment.