forked from thomasmunduchira/myq-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.js
66 lines (64 loc) · 1.86 KB
/
constants.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
const authVersion = 'v5';
const deviceVersion = 'v5.1';
const constants = {
authBase: `https://api.myqdevice.com/api/${authVersion}`,
deviceBase: `https://api.myqdevice.com/api/${deviceVersion}`,
allDeviceTypes: {
hub: 'hub',
virtualGarageDoorOpener: 'virtualgaragedooropener',
wifiGarageDoorOpener: 'wifigaragedooropener',
wifiGdoGateway: 'wifigdogateway',
},
errorMessages: {
11: 'Something unexpected happened. Please wait a bit and try again.',
12: 'MyQ service is currently down. Please wait a bit and try again.',
13: 'Not logged in.',
14: 'Email and/or password are incorrect.',
15: 'Invalid parameter(s) provided.',
16: 'User will be locked out due to too many tries. 1 try left.',
17: 'User is locked out due to too many tries. Please reset password and try again.',
18: 'The requested device could not be found.',
19: 'Unable to determine the state of the requested device.',
20: 'Could not find that URL. Please file a bug report.',
},
doorCommands: {
close: 'close',
open: 'open',
},
doorStates: {
1: 'open',
2: 'closed',
3: 'stopped in the middle',
4: 'going up',
5: 'going down',
9: 'not closed',
},
headers: {
defaultUserAgent: 'okhttp/3.10.0',
deviceApiVersion: deviceVersion,
defaultBrandId: 2,
defaultCulture: 'en',
appId: 'JVM/G9Nwih5BwKgNCjLxiFUQxQijAebyyg8QUHr7JOrP+tuPb8iHfRHKwTmDzHOu',
},
lightCommands: {
on: 'on',
off: 'off',
},
lightStates: {
0: 'turnoff',
1: 'turnon',
},
myQProperties: {
doorState: 'door_state',
lastUpdate: 'last_update',
lightState: 'light_state',
online: 'online',
},
routes: {
account: '/My',
getDevices: '/Accounts/{accountId}/Devices',
login: '/Login',
setDevice: '/Accounts/{accountId}/Devices/{serialNumber}/actions',
},
};
module.exports = constants;