How to use patatmo
¶
Creating a NetatmoClient
¶
All patatmo
does is querying the Netatmo API. This is done via a NetatmoClient
:
import patatmo
# your patatmo connect developer credentials
credentials = {
"password":"5uP3rP45sW0rD",
"username":"user.email@internet.com",
"client_id": "03012823b3fd2e420fbf980b",
"client_secret":"YXNkZmFzZGYgamFzamYgbGFzIG"
}
# create an api client
client = patatmo.api.client.NetatmoClient()
# tell the client's authentication your credentials
client.authentication.credentials = credentials
# optionally give the authentication a temporary file.
# The tokens are then stored there for later reuse,
# e.g. next time you invoke this script.
# This saves time because no new tokens have to be requested.
# New tokens are then only requested if the old ones expire.
client.authentication.tmpfile = "temp_auth.json"
Have a look at the Examples to learn what to do with a
NetatmoClient
.