Skip to content

Commit 58959d1

Browse files
committed
Update documentation
1 parent bcb5c73 commit 58959d1

File tree

2 files changed

+58
-15
lines changed

2 files changed

+58
-15
lines changed

README.md

Lines changed: 58 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,11 @@
77

88
A fully async and easy to use API client for the (internal) OverKiz API. You can use this client to interact with smart devices connected to the OverKiz platform, used by various vendors like Somfy TaHoma and Atlantic Cozytouch.
99

10-
This package is written for the Home Assistant [ha-tahoma](https://github.com/iMicknl/ha-tahoma) integration, but could be used by any Python project interacting with OverKiz hubs.
11-
12-
> Somfy TaHoma has an official API, which can be consumed via the [somfy-open-api](https://github.com/tetienne/somfy-open-api). Unfortunately only a few device classes are supported via the official API, thus the need for this API client.
10+
This package is written for the Home Assistant [Overkiz](https://www.home-assistant.io/integrations/overkiz/) integration, but could be used by any Python project interacting with OverKiz hubs.
1311

1412
## Supported hubs
1513

16-
- Atlantic Cozytouch
17-
- Bouygues Flexom
18-
- Hitachi Hi Kumo
19-
- Nexity Eugénie
20-
- Rexel Energeasy Connect
21-
- Simu (LiveIn2)
22-
- Somfy Connexoon IO
23-
- Somfy Connexoon RTS
24-
- Somfy TaHoma
25-
- Somfy TaHoma Switch
26-
- Thermor Cozytouch
14+
See [pyoverkiz/const.py](./pyoverkiz/const.py)
2715

2816
## Installation
2917

@@ -33,6 +21,62 @@ pip install pyoverkiz
3321

3422
## Getting started
3523

24+
### API Documentation
25+
26+
A subset of the API is [documented and maintened](https://somfy-developer.github.io/Somfy-TaHoma-Developer-Mode) by Somfy.
27+
28+
### Local API or Developper mode
29+
30+
See https://github.com/Somfy-Developer/Somfy-TaHoma-Developer-Mode#getting-started
31+
32+
For the moment, only Tahoma and Conexoon hubs from Somfy Europe can enabled this mode. Not all the devices are returned. You can have more details [here](https://github.com/Somfy-Developer/Somfy-TaHoma-Developer-Mode/issues/20).
33+
34+
```python
35+
import asyncio
36+
import time
37+
38+
from aiohttp import ClientSession
39+
40+
from pyoverkiz.clients.overkiz import OverkizClient
41+
from pyoverkiz.const import Server
42+
from pyoverkiz.overkiz import Overkiz
43+
44+
USERNAME = ""
45+
PASSWORD = ""
46+
47+
48+
async def main() -> None:
49+
50+
async with ClientSession() as session:
51+
client = Overkiz.get_client_for(
52+
Server.SOMFY_EUROPE, USERNAME, PASSWORD, session
53+
)
54+
try:
55+
await client.login()
56+
except Exception as exception: # pylint: disable=broad-except
57+
print(exception)
58+
return
59+
60+
devices = await client.get_devices()
61+
62+
for device in devices:
63+
print(f"{device.label} ({device.id}) - {device.controllable_name}")
64+
print(f"{device.widget} - {device.ui_class}")
65+
66+
await client.register_event_listener()
67+
68+
while True:
69+
events = await client.fetch_events()
70+
print(events)
71+
72+
time.sleep(2)
73+
74+
75+
asyncio.run(main())
76+
```
77+
78+
### Cloud API
79+
3680
```python
3781
import asyncio
3882
import time

pyoverkiz/clients/overkiz.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,6 @@ async def generate_local_token(self, gateway_id: str) -> str:
449449
Access scope : Full enduser API access (enduser/*)
450450
"""
451451
response = await self.get(f"config/{gateway_id}/local/tokens/generate")
452-
print(response)
453452

454453
return cast(str, response["token"])
455454

0 commit comments

Comments
 (0)