Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tetienne committed Feb 22, 2023
1 parent bcb5c73 commit 56be3a5
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 15 deletions.
72 changes: 58 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,11 @@

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.

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.

> 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.
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.

## Supported hubs

- Atlantic Cozytouch
- Bouygues Flexom
- Hitachi Hi Kumo
- Nexity Eugénie
- Rexel Energeasy Connect
- Simu (LiveIn2)
- Somfy Connexoon IO
- Somfy Connexoon RTS
- Somfy TaHoma
- Somfy TaHoma Switch
- Thermor Cozytouch
See [pyoverkiz/const.py](./pyoverkiz/const.py#L19)

## Installation

Expand All @@ -33,6 +21,62 @@ pip install pyoverkiz

## Getting started

### API Documentation

A subset of the API is [documented and maintened](https://somfy-developer.github.io/Somfy-TaHoma-Developer-Mode) by Somfy.

### Local API or Developper mode

See https://github.com/Somfy-Developer/Somfy-TaHoma-Developer-Mode#getting-started

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).

```python
import asyncio
import time

from aiohttp import ClientSession

from pyoverkiz.clients.overkiz import OverkizClient
from pyoverkiz.const import Server
from pyoverkiz.overkiz import Overkiz

USERNAME = ""
PASSWORD = ""


async def main() -> None:

async with ClientSession() as session:
client = Overkiz.get_client_for(
Server.SOMFY_EUROPE, USERNAME, PASSWORD, session
)
try:
await client.login()
except Exception as exception: # pylint: disable=broad-except
print(exception)
return

devices = await client.get_devices()

for device in devices:
print(f"{device.label} ({device.id}) - {device.controllable_name}")
print(f"{device.widget} - {device.ui_class}")

await client.register_event_listener()

while True:
events = await client.fetch_events()
print(events)

time.sleep(2)


asyncio.run(main())
```

### Cloud API

```python
import asyncio
import time
Expand Down
1 change: 0 additions & 1 deletion pyoverkiz/clients/overkiz.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ async def generate_local_token(self, gateway_id: str) -> str:
Access scope : Full enduser API access (enduser/*)
"""
response = await self.get(f"config/{gateway_id}/local/tokens/generate")
print(response)

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

Expand Down

0 comments on commit 56be3a5

Please sign in to comment.