Netatmo python client
The python-netatmo-client repo contains a Python client library for Netatmo.
Installing
So far only source is the way of installing it:
From sources
To build the library run :
$ python setup.py install
How to use it
First of all you must declare your own application and get your client id and client secret.
Build an instance
from netatmo_client.client import NetatmoClient
scopes = ('read_station',
'read_thermostat',
'write_thermostat',
'read_camera')
client_id = 'client id'
client_secret = 'client secret'
client = NetatmoClient(client_id, client_secret)
Get the tokens
The library provides you two way of logging the client
Grant code process
Providing that you declared http://somewhere.org/callback/grant/code as a redirect uri on the netatmo site, you may get your tokens using the grant code way with a code like follows.
client = NetatmoClient('client-id', 'client-secret')
scopes = ('read_station',
'read_thermostat',
'write_thermostat',
'read_camera')
redirect_uri = 'http://somewhere.org/callback/grant/code'
grant_url = client.generate_auth_url(redirect_uri, 'state-test', *scopes)
sys.stdout\
.write("Open the following url ( %s ), follow the steps and enter the code you will see in the navigation bar: "
% grant_url)
code = sys.stdin.readline()
code = code.rstrip('\r\n')
client.request_token_with_code(code, redirect_uri, *scopes)
# use the api
print json.dumps(client.station.get_station_data())
The user will be lead to the grant code process and return to your site with a url such as http://somewhere.org/callback/grant/code?code=<your code>&state=state-test. Then normally a webserver of yours handles the GET request, and exchanges the code using the same redirect uri as above.
Client credentials
You may also choose this process as follows:
client = NetatmoClient('client-id', 'client-secret')
scopes = ('read_station',
'read_thermostat',
'write_thermostat',
'read_camera')
client.request_token_with_client_credentials('username', 'password', *scopes)
# use the api
print json.dumps(client.thermostat.get_thermostat_data())
The api calls
The client defines three parts:
- common:
get_measure
- public:
get_public_data
- station:
get_station_data
- thermostat:
get_thermostat_data
create_new_schedule
set_therm_point
switch_schedule
sync_schedule
- welcome
get_camera_picture
get_events_until
get_next_events
get_home_data
get_last_event_of
add_webhook
drop_webhook
ping
Issues and contributions
Please submit issue/pull request.
Metadata
Release files for netatmo-client 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| netatmo-client-0.0.3.zip | 14.5 kB | Without provenance | Details for netatmo-client-0.0.3.zip |
Release files / netatmo-client-0.0.3.zip
| Download URL | netatmo-client-0.0.3.zip |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f01431ded3d0b337e7bb451204a6c85a9e0a1b6d03b3ab2c52bd5c94c92c0bb
|
|
BLAKE2b-256 checksum How to use checksums |
13bd3f0517afe37c2217d25affd6d60ab3e199531945756d5578c679ced8946a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for netatmo-client 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.