Adrian Sampson
94a1ec8531
Construct a client from a token
2018-01-20 22:02:22 -05:00
Adrian Sampson
8179148342
Inline the load/dump bits
...
The ol' expression problem strikes again.
2018-01-20 21:51:49 -05:00
Adrian Sampson
ebc9c5b679
Make load into a class method
2018-01-20 21:47:32 -05:00
Adrian Sampson
2ce09e9642
Move Client to main module
2018-01-20 21:43:02 -05:00
Adrian Sampson
f50c8d0221
Simplify retry loop
2018-01-20 21:39:37 -05:00
Adrian Sampson
b2bc017d99
Cache device list
2018-01-20 21:35:09 -05:00
Adrian Sampson
948d51b1b6
Try wrapping stuff up in a mutable client class
2018-01-20 21:33:44 -05:00
Adrian Sampson
0dde92b241
Docstring
2018-01-20 17:16:36 -05:00
Adrian Sampson
2083357165
Remove a key we don't need
2018-01-20 17:14:23 -05:00
Adrian Sampson
b3315c60c8
Refresh session in example
2018-01-20 17:02:43 -05:00
Adrian Sampson
1dfbc7db8f
Factor out the refresh function
2018-01-20 16:58:49 -05:00
Adrian Sampson
0648876cc0
Extract new access token
2018-01-20 16:54:53 -05:00
Adrian Sampson
8653810e0d
Actually, the secret is ASCII bytes
...
It looks like hex, but really it's just ASCII. Wow!
2018-01-20 16:51:20 -05:00
Adrian Sampson
3b5b6ca07f
Fix fake URL used in signature
2018-01-20 14:53:26 -05:00
Adrian Sampson
105646263f
Remove apparently-unnecessary headers
2018-01-20 14:47:42 -05:00
Adrian Sampson
ccddf40187
Decode OAuth secret
2018-01-20 14:42:40 -05:00
Adrian Sampson
ba3d423893
Set up OAuth token refresh
2018-01-20 14:35:27 -05:00
Adrian Sampson
35a78281d6
Auth.from_url helper
2018-01-20 13:56:16 -05:00
Adrian Sampson
8fc2749a9b
Obtain refresh token from OAuth
2018-01-20 13:53:19 -05:00
Adrian Sampson
29eb1804c5
Run monitor loop indefinitely
2018-01-08 14:47:27 -08:00
Adrian Sampson
336b7ec956
Fix format of control call
2018-01-08 14:46:04 -08:00
Adrian Sampson
c9afb9035c
Start controlling settings
2018-01-08 14:39:50 -08:00
Adrian Sampson
244f4756c5
Pull out temperatures
2018-01-08 14:26:14 -08:00
Adrian Sampson
b8b50e5309
Little "subcommands" in the example
2018-01-08 14:21:09 -08:00
Adrian Sampson
d2735be4ad
Unpack poll results
2018-01-08 14:16:43 -08:00
Adrian Sampson
d09820dbbd
Fix monitor polling
...
- It looks like `workList` as returned is not really a list.
- The workId we generate appears to be thrown away, in favor of a new
one returned by the service.
- The stop endpoint really does need the device ID.
This is a pretty bad API!
2018-01-08 14:11:56 -08:00
Adrian Sampson
d0a4e3e823
Try out monitoring
2018-01-08 14:03:46 -08:00
Adrian Sampson
3f6b4f1bf8
Sketch unused monitoring stuff
2018-01-08 13:51:44 -08:00
Adrian Sampson
9bf7918314
Don't raise OK responses as errors
2018-01-08 13:25:50 -08:00
Adrian Sampson
e31f126cd9
Refactor session creator into function
2018-01-08 13:24:53 -08:00
Adrian Sampson
5ffa880e80
Handle the error
2018-01-08 13:16:27 -08:00
Adrian Sampson
04b4c7a6ce
Special error for expired sessions
2018-01-08 13:09:04 -08:00
Adrian Sampson
375ee62ce3
Exceptions for API errors
2018-01-08 13:06:47 -08:00
Adrian Sampson
3e11db0f7b
Further refactor deviceList API call
2018-01-08 12:06:54 -08:00
Adrian Sampson
7aacb19082
Refactor common request function
2018-01-08 12:00:01 -08:00
Adrian Sampson
7ff25e9eea
Move OO interface to the library
2018-01-08 11:44:08 -08:00
Adrian Sampson
82fca74b05
Use a chain of objects for getting a session
2018-01-08 11:37:59 -08:00
Adrian Sampson
696f728752
Revert "Crude memoization helper"
...
This reverts commit a28dd98d77a6aacb6288cb7c371aa2091023b79a.
2018-01-08 10:13:03 -08:00
Adrian Sampson
a28dd98d77
Crude memoization helper
2018-01-08 08:53:05 -08:00
Adrian Sampson
a712ceb9ec
README and license
2018-01-06 14:33:55 -08:00
Adrian Sampson
211c303891
Just print the alias
2018-01-06 14:31:46 -08:00
Adrian Sampson
fc0a7943b5
Pull out the list of device data
2018-01-06 14:30:17 -08:00
Adrian Sampson
705b353718
Get device list
2018-01-06 14:29:51 -08:00
Adrian Sampson
c9d67a735b
Pull out the session ID
2018-01-06 14:26:19 -08:00
Adrian Sampson
e79b67051c
Some memoization
2018-01-06 14:21:39 -08:00
Adrian Sampson
009ed8e330
Move smoke test to its own file
2018-01-06 14:14:36 -08:00
Adrian Sampson
6a2f4321d3
More minimal login request
2018-01-06 14:10:47 -08:00
Adrian Sampson
c49d6b3edf
Sufficient login request
2018-01-06 14:09:52 -08:00
Adrian Sampson
9e700f99b6
Extract access_token from response URL
2018-01-06 13:53:56 -08:00
Adrian Sampson
e053521bc5
Generate OAuth URL
2018-01-06 13:34:40 -08:00