Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ Python 3.7+ required.

The Sagemcom F@st series is used by multiple cable companies, where some cable companies did rebrand the router. Examples are the b-box from Proximus, Home Hub from bell and the Smart Hub from BT.

| Router Model | Provider(s) | Authentication Method |
| -------------------- | -------------------- | --------------------- |
| Sagemcom F@st 3864 | Optus | sha512 |
| Sagemcom F@st 3865b | Proximus (b-box3) | md5 |
| Sagemcom F@st 3890V3 | Delta / Zeelandnet | md5 |
| Sagemcom F@st 4360Air| KPN | md5 |
| Sagemcom F@st 5250 | Bell (Home Hub 2000) | md5 |
| Sagemcom F@st 5280 | | sha512 |
| Sagemcom F@st 5364 | BT (Smart Hub) | md5 |
| Sagemcom F@st 5370e | Telia | sha512 |
| Sagemcom F@st 5566 | Bell (Home Hub 3000) | md5 |
| Sagemcom F@st 5655V2 | MásMóvil | md5 |
| Speedport Pro | Telekom | md5 |
| Router Model | Provider(s) | Authentication Method | Comments |
| --------------------- | -------------------- | --------------------- | ----------------------------- |
| Sagemcom F@st 3864 | Optus | sha512 | username: guest, password: "" |
| Sagemcom F@st 3865b | Proximus (b-box3) | md5 | |
| Sagemcom F@st 3890V3 | Delta / Zeelandnet | md5 | |
| Sagemcom F@st 4360Air | KPN | md5 | |
| Sagemcom F@st 5250 | Bell (Home Hub 2000) | md5 | username: guest, password: "" |
| Sagemcom F@st 5280 | | sha512 | |
| Sagemcom F@st 5364 | BT (Smart Hub) | md5 | username: guest, password: "" |
| Sagemcom F@st 5370e | Telia | sha512 | |
| Sagemcom F@st 5566 | Bell (Home Hub 3000) | md5 | username: guest, password: "" |
| Sagemcom F@st 5655V2 | MásMóvil | md5 | |
| Speedport Pro | Telekom | md5 | |

> Contributions welcome. If you router model is supported by this package, but not in the list above, please create [an issue](https://github.com/iMicknl/python-sagemcom-api/issues/new) or pull request.

Expand Down Expand Up @@ -96,9 +96,11 @@ asyncio.run(main())
## Advanced

### Determine the EncryptionMethod

(not supported yet)

### Handle exceptions

Some functions may cause an error when an attempt is made to execute it. These exceptions are thrown by the client and need to be [handled in your Python program](https://docs.python.org/3/tutorial/errors.html#handling-exceptions). Best practice is to catch some specific exceptions and handle them gracefully.

```python
Expand All @@ -123,7 +125,7 @@ except Exception as exception:
print(exception)
```

### Use your own aiohttp ClientSession
### Use your own aiohttp ClientSession

> ClientSession is the heart and the main entry point for all client API operations. The session contains a cookie storage and connection pool, thus cookies and connections are shared between HTTP requests sent by the same session.

Expand All @@ -136,7 +138,6 @@ session = ClientSession(timeout=ClientTimeout(100))
client = SagemcomClient(session=session)
```


## Inspired by

- [wuseman/SAGEMCOM-FAST-5370e-TELIA](https://github.com/wuseman/SAGEMCOM-FAST-5370e-TELIA)
Expand Down
2 changes: 1 addition & 1 deletion sagemcom_api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(
host,
username,
password,
authentication_method=EncryptionMethod.UNKNOWN,
authentication_method,
session: ClientSession = None,
):
"""
Expand Down
11 changes: 3 additions & 8 deletions sagemcom_api/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@


class EncryptionMethod(Enum):
"""TODO."""
"""Encryption method defining the password hash."""

def __str__(self):
"""TODO."""
return str(self.value)

MD5 = "md5"
SHA512 = "sha512"
UNKNOWN = "unknown"
MD5 = "MD5"
SHA512 = "SHA512"