Skip to content

Commit 20eb40a

Browse files
committed
Update documentation: remove outdated authentication guide and enhance getting started section
1 parent 0fc8399 commit 20eb40a

File tree

4 files changed

+75
-122
lines changed

4 files changed

+75
-122
lines changed

docs/authentication.md

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

docs/getting-started.md

Lines changed: 67 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Getting started
22

3+
This guide will help you install the library, connect to your hub, and perform your first actions.
4+
35
## Prerequisites
46

57
- Python 3.10+
68
- An OverKiz-compatible hub and account
79

8-
## Install pyOverkiz from PyPi
9-
10+
## Install pyOverkiz from PyPI
1011

11-
### With UV <small>recommended</small> { #with-uv data-toc-label="with uv" }
12+
### With UV <small>recommended</small>
1213

1314
```bash
1415
uv add pyoverkiz
@@ -27,78 +28,88 @@ Use a cloud server when you want to connect through the vendor’s public API. U
2728
- Cloud servers use the `Server` enum.
2829
- Local servers use `create_local_server_config` with a hostname or IP address.
2930

30-
## First login (cloud)
31+
## Authentication
3132

32-
```python
33-
import asyncio
33+
=== "Somfy (cloud)"
3434

35-
from pyoverkiz.auth.credentials import UsernamePasswordCredentials
36-
from pyoverkiz.client import OverkizClient
37-
from pyoverkiz.enums import Server
35+
Cloud authentication uses a vendor server from `Server` plus `UsernamePasswordCredentials`.
3836

37+
```python
38+
import asyncio
3939

40-
async def main() -> None:
41-
async with OverkizClient(
42-
server=Server.SOMFY_EUROPE,
43-
credentials=UsernamePasswordCredentials("you@example.com", "password"),
44-
) as client:
45-
await client.login()
46-
print(await client.get_setup())
40+
from pyoverkiz.auth.credentials import UsernamePasswordCredentials
41+
from pyoverkiz.client import OverkizClient
42+
from pyoverkiz.enums import Server
4743

4844

49-
asyncio.run(main())
50-
```
45+
async def main() -> None:
46+
async with OverkizClient(
47+
server=Server.SOMFY_EUROPE,
48+
credentials=UsernamePasswordCredentials("you@example.com", "password"),
49+
) as client:
50+
await client.login()
5151

52-
## First login (local)
52+
asyncio.run(main())
53+
```
5354

54-
```python
55-
import asyncio
55+
=== "Somfy (local)"
5656

57-
from pyoverkiz.auth.credentials import LocalTokenCredentials
58-
from pyoverkiz.client import OverkizClient
59-
from pyoverkiz.utils import create_local_server_config
57+
Local authentication requires a token generated by the official mobile app and a local user on the OverKiz API platform.
6058

59+
```python
60+
import asyncio
6161

62-
async def main() -> None:
63-
async with OverkizClient(
64-
server=create_local_server_config(host="gateway-xxxx.local"),
65-
credentials=LocalTokenCredentials("local-token"),
66-
verify_ssl=False,
67-
) as client:
68-
await client.login()
69-
print(await client.get_setup())
62+
from pyoverkiz.auth.credentials import LocalTokenCredentials
63+
from pyoverkiz.client import OverkizClient
64+
from pyoverkiz.utils import create_local_server_config
7065

7166

72-
asyncio.run(main())
73-
```
67+
async def main() -> None:
68+
async with OverkizClient(
69+
server=create_local_server_config(host="gateway-xxxx.local"),
70+
credentials=LocalTokenCredentials("local-token"),
71+
verify_ssl=True, # disable if you connect via IP
72+
) as client:
73+
await client.login()
7474

75-
## Sanity check: list devices
75+
asyncio.run(main())
76+
```
7677

77-
```python
78-
import asyncio
78+
=== "Cozytouch (cloud)"
7979

80-
from pyoverkiz.auth.credentials import UsernamePasswordCredentials
81-
from pyoverkiz.client import OverkizClient
82-
from pyoverkiz.enums import Server
80+
```python
81+
import asyncio
8382

83+
from pyoverkiz.auth.credentials import UsernamePasswordCredentials
84+
from pyoverkiz.client import OverkizClient
85+
from pyoverkiz.enums import Server
8486

85-
async def main() -> None:
86-
async with OverkizClient(
87-
server=Server.SOMFY_EUROPE,
88-
credentials=UsernamePasswordCredentials("you@example.com", "password"),
89-
) as client:
90-
await client.login()
91-
devices = await client.get_devices()
92-
for device in devices:
93-
print(f"{device.label} ({device.id}) -> {device.widget}")
9487

88+
async def main() -> None:
89+
async with OverkizClient(
90+
server=Server.SOMFY_EUROPE,
91+
credentials=UsernamePasswordCredentials("you@example.com", "password"),
92+
) as client:
93+
await client.login()
9594

96-
asyncio.run(main())
95+
asyncio.run(main())
96+
```
9797

98-
## Next steps
98+
=== "Rexel (cloud)"
9999

100-
- Learn about authentication flows in [docs/authentication.md](docs/authentication.md).
101-
- Control devices and run actions in [docs/device-control.md](docs/device-control.md).
102-
- Handle events in [docs/event-handling.md](docs/event-handling.md).
103-
- Understand errors in [docs/error-handling.md](docs/error-handling.md).
104-
```
100+
```python
101+
import asyncio
102+
103+
from pyoverkiz.auth.credentials import UsernamePasswordCredentials
104+
from pyoverkiz.client import OverkizClient
105+
from pyoverkiz.enums import Server
106+
107+
async def main() -> None:
108+
async with OverkizClient(
109+
server=Server.SOMFY_EUROPE,
110+
credentials=UsernamePasswordCredentials("you@example.com", "password"),
111+
) as client:
112+
await client.login()
113+
114+
asyncio.run(main())
115+
```

docs/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ hide:
44
- toc
55
- title
66
---
7-
# pyOverkiz
7+
<style>
8+
.md-content__inner > h1:first-of-type {
9+
display: none;
10+
}
11+
</style>
812

913
pyOverkiz is an async Python library for interacting with Overkiz-based platforms, including Somfy and Atlantic. It enables authentication, device discovery, state reading, command execution, and real-time event streaming from supported gateways.
1014

mkdocs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ markdown_extensions:
3535
- pymdownx.superfences
3636
- pymdownx.tasklist
3737
- admonition
38+
- pymdownx.superfences
39+
- pymdownx.tabbed:
40+
alternate_style: true
3841

3942
nav:
4043
- Overview: index.md
4144
- User Guide:
4245
- Getting started: getting-started.md
43-
- Authentication: authentication.md
4446
- Core concepts: core-concepts.md
4547
- Device control: device-control.md
4648
- Event handling: event-handling.md

0 commit comments

Comments
 (0)