You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: usage.md
+24-25Lines changed: 24 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,35 +39,34 @@ In the netatmo philosophy, both the application itself and the user have to be r
39
39
40
40
41
41
42
-
Copy the lnetatmo.py file in your work directory (or your platform choice of user libraries or virtualenv or ...).
42
+
Copy the lnetatmo.py file in your work directory (or use pip install lnetatmo).
43
43
44
44
Authentication data can be supplied with 4 different methods :
45
45
46
46
1. Some or all values can be hard coded in the library source (and default to empty strings). If you use this method, you are back to the initial suggested method. It would be nice to switch to other methods to isolate credentials and ease library upgrades.
47
-
2. Some or all values can be overriden in a ~/.netatmo.credentials file containing the keys in JSON format
48
-
```bash
49
-
$ cat .netatmo.credentials # Here all values are defined but it is not mandatory
50
-
{
51
-
"CLIENT_ID":"`xxx",
52
-
"CLIENT_SECRET" : "xxx",
53
-
"USERNAME" : "xxx",
54
-
"PASSWORD" : "xxx"
55
-
}
56
-
$
57
-
```
58
-
3. Some or all values can be overriden by environment variables. This is the easiest method if your are packaging your application with Docker.
59
-
```bash
60
-
$ export USERNAME=newUsername
61
-
$ export PASSWORD=password
62
-
$ python3 MyCodeUsingLnetatmo.py
63
-
...
64
-
```
65
-
4. Some or all values can be overriden by explicit call to initializer of ClientAuth class
66
-
```python
67
-
# Example: CLIENT_ID and CLIENT_SECRET supposed to be defined by one of the previous methods
If you provide all the values, using any method or mix except 4, you can test that everything is working properly by simply running the package as a standalone program.
0 commit comments