Skip to content

Commit 0de9846

Browse files
authored
Clean up for first release (#19)
1 parent 2df6a06 commit 0de9846

File tree

8 files changed

+59
-60
lines changed

8 files changed

+59
-60
lines changed

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,44 @@ This package is written for the Home Assistant [ha-tahoma](https://github.com/iM
1414
## Installation
1515

1616
```bash
17-
pip install git+https://github.com/iMicknl/python-tahoma-api.git@master#tahoma_api
17+
pip install pyhoma
18+
```
19+
20+
## Getting started
21+
22+
```python
23+
import asyncio
24+
import time
25+
26+
from pyhoma.client import TahomaClient
27+
28+
USERNAME = ""
29+
PASSWORD = ""
30+
31+
async def main() -> None:
32+
async with TahomaClient(USERNAME, PASSWORD) as client:
33+
try:
34+
await client.login()
35+
except Exception as exception: # pylint: disable=broad-except
36+
print(exception)
37+
return
38+
39+
devices = await client.get_devices()
40+
41+
for device in devices:
42+
print(f"{device.label} ({device.id}) - {device.controllable_name}")
43+
print(f"{device.widget} - {device.ui_class}")
44+
45+
# Create an event listener and poll it
46+
listener_id = await client.register_event_listener()
47+
48+
while True:
49+
events = await client.fetch_event_listener(listener_id)
50+
print(events)
51+
52+
time.sleep(2)
53+
54+
asyncio.run(main())
1855
```
1956

2057
## Development

poetry.lock

Lines changed: 14 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import humps
1010
from aiohttp import ClientResponse
1111

12-
from tahoma_api.exceptions import BadCredentialsException, TooManyRequestsException
13-
from tahoma_api.models import Command, Device, Event, Execution, Scenario, State
12+
from pyhoma.exceptions import BadCredentialsException, TooManyRequestsException
13+
from pyhoma.models import Command, Device, Event, Execution, Scenario, State
1414

1515
JSON = Union[Dict[str, Any], List[Dict[str, Any]]]
1616

File renamed without changes.

pyproject.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
[tool.poetry]
2-
name = "python-tahoma-api"
3-
version = "0.1.0"
4-
description = "Python wrapper to interact with internal Somfy TaHoma API"
2+
name = "pyhoma"
3+
version = "0.2.0"
4+
description = "Async Python wrapper to interact with internal Somfy TaHoma API"
55
authors = ["Mick Vleeshouwer", "Vincent Le Bourlot", "Thibaut Etienne"]
66
license = "MIT"
77
readme = "README.md"
88
homepage = "https://github.com/iMicknl/python-tahoma-api"
99
repository = "https://github.com/iMicknl/python-tahoma-api"
1010
packages = [
11-
{ include = "tahoma_api" },
12-
{ include = "tahoma_api/**/*.py" },
11+
{ include = "pyhoma" }
1312
]
1413

1514
[tool.poetry.dependencies]
1615
python = ">=3.6"
17-
aiohttp = "3.6.1"
16+
aiohttp = "^3.6.1"
1817
pyhumps = "^1.3.1"
1918

2019
[tool.poetry.dev-dependencies]

test.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)