Metadata-Version: 2.4
Name: pytcs_tecnoalarm
Version: 0.2
Summary: LIbrary to interact with Tecnoalarm TCS app backend
Project-URL: Homepage, https://github.com/icovada/pytcs
Project-URL: Issues, https://github.com/icovada/pytcs/issues
Author-email: Federico Tabbò <federico@tabbo.it>
License-Expression: GPL-3.0
License-File: LICENSE
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Requires-Dist: pydantic
Requires-Dist: requests
Requires-Dist: retry
Description-Content-Type: text/markdown

# Python library to interface with myTecnoalarm TCS app cloud services

This repo provides code to interface with the cloud services of the "my Tecnoalarm TCS" app.
Funcionality has been reverse-engineered and may not be complete.

## How to install it

`pip install pytcs-tecnoalarm`

## How to use it

To use this library you need to authenticate to the cloud service.

### First login

Open an interactive prompt and run:

```python
from pytcs_tecnoalarm import TCSSession
s = TCSSession()
s.login(email, password)
```

If your account does not have 2 factor authenticator, you will be logged in.
Otherwise, this will throw an `OTPException`

Get the code from your email and run

```python
s.login(email, password, pin)
```

If everything goes right, you will have an authenticated token and app-id to re-use in the future
(does not seem to expire)

extract then with

```python
s.token
s.appid
```

### Future logins

Simply pass your token and appid when instantiating the session

```python
from pytcs_tecnoalarm import TCSSession
s = TCSSession(token, appid)
```

This will run the `.re_auth()` function that should re-enable the token for immediate use.

The token never changes.
