homebridge-dummy 1.1.0-beta.0 → 1.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -14
- package/README.md +68 -10
- package/config.schema.json +218 -83
- package/dist/accessory/base.d.ts +6 -4
- package/dist/accessory/base.js +15 -17
- package/dist/accessory/base.js.map +1 -1
- package/dist/accessory/helpers.js +3 -0
- package/dist/accessory/helpers.js.map +1 -1
- package/dist/accessory/lock.d.ts +2 -1
- package/dist/accessory/lock.js +12 -5
- package/dist/accessory/lock.js.map +1 -1
- package/dist/accessory/onoff/onoff.d.ts +2 -1
- package/dist/accessory/onoff/onoff.js +10 -3
- package/dist/accessory/onoff/onoff.js.map +1 -1
- package/dist/accessory/position/position.d.ts +2 -1
- package/dist/accessory/position/position.js +11 -4
- package/dist/accessory/position/position.js.map +1 -1
- package/dist/accessory/thermostat.d.ts +28 -0
- package/dist/accessory/thermostat.js +147 -0
- package/dist/accessory/thermostat.js.map +1 -0
- package/dist/homebridge-ui/public/index.html +1 -1
- package/dist/i18n/en.d.ts +31 -1
- package/dist/i18n/en.js +36 -6
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/i18n.d.ts +31 -1
- package/dist/i18n/template.d.ts +31 -1
- package/dist/i18n/zz.d.ts +31 -1
- package/dist/model/timer.d.ts +9 -5
- package/dist/model/timer.js +33 -30
- package/dist/model/timer.js.map +1 -1
- package/dist/model/trigger.d.ts +18 -0
- package/dist/model/trigger.js +92 -0
- package/dist/model/trigger.js.map +1 -0
- package/dist/model/types.d.ts +31 -0
- package/dist/model/types.js +18 -0
- package/dist/model/types.js.map +1 -1
- package/dist/tools/storage.d.ts +1 -0
- package/dist/tools/storage.js +1 -0
- package/dist/tools/storage.js.map +1 -1
- package/dist/tools/temperature.d.ts +3 -0
- package/dist/tools/temperature.js +14 -0
- package/dist/tools/temperature.js.map +1 -0
- package/dist/tools/time.d.ts +5 -0
- package/dist/tools/time.js +15 -0
- package/dist/tools/time.js.map +1 -0
- package/package.json +3 -1
package/dist/i18n/en.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const en = {
|
|
2
2
|
accessory: {
|
|
3
|
+
invalidCron: '%s has an invalid cron expression %s', // accessory name, cron string
|
|
3
4
|
missingRequired: '%s is missing required config variable %s', // accessory name, variable name
|
|
4
5
|
command: {
|
|
5
6
|
executed: '%s executed command', // accessory name
|
|
@@ -21,6 +22,15 @@ const en = {
|
|
|
21
22
|
closed: '%s is closed', // accessory name
|
|
22
23
|
open: '%s is open', // accessory name
|
|
23
24
|
},
|
|
25
|
+
thermostat: {
|
|
26
|
+
auto: '%s set to Auto', // accessory name
|
|
27
|
+
cool: '%s set to Cool', // accessory name
|
|
28
|
+
heat: '%s set to Heat', // accessory name
|
|
29
|
+
off: '%s set to Off', // accessory name
|
|
30
|
+
temperatureC: '%s set to %s°C', // accessory name
|
|
31
|
+
temperatureF: '%s set to %s°F', // accessory name
|
|
32
|
+
unsupportedFunction: '%s is unsupported for thermostats', // function name
|
|
33
|
+
},
|
|
24
34
|
timer: {
|
|
25
35
|
cancel: 'Cancelled the timer for %s', // accessory name
|
|
26
36
|
reset: 'Reset the timer for %s', // accessory name
|
|
@@ -28,6 +38,12 @@ const en = {
|
|
|
28
38
|
setMinutes: '%s is waiting %s minutes', // accessory name, number
|
|
29
39
|
setHours: '%s is waiting %s hours', // accessory name, number
|
|
30
40
|
},
|
|
41
|
+
trigger: {
|
|
42
|
+
cron: '%s starting trigger cronjob', // accessory name
|
|
43
|
+
intervalSeconds: '%s will trigger in %s seconds', // accessory name, number
|
|
44
|
+
intervalMinutes: '%s will trigger in %s minutes', // accessory name, number
|
|
45
|
+
intervalHours: '%s will trigger in %s hours', // accessory name, number
|
|
46
|
+
},
|
|
31
47
|
},
|
|
32
48
|
config: {
|
|
33
49
|
migrate: 'Are you upgrading from an earlier version?',
|
|
@@ -43,17 +59,26 @@ const en = {
|
|
|
43
59
|
yes: 'Yes',
|
|
44
60
|
no: 'No',
|
|
45
61
|
description: {
|
|
46
|
-
commands: 'Execute
|
|
47
|
-
|
|
48
|
-
|
|
62
|
+
commands: 'Execute arbitrary commands when the accessory changes state',
|
|
63
|
+
cron: 'Visit crontab.guru for help',
|
|
64
|
+
random: 'Time will be randomized with the above value as a maximum',
|
|
65
|
+
timer: 'Return the accessory to its default value after the specified delay',
|
|
66
|
+
trigger: 'Set the accessory to its opposite (non-default) value at specified interval or times',
|
|
49
67
|
},
|
|
50
68
|
enumNames: {
|
|
69
|
+
auto: 'Auto',
|
|
51
70
|
carbonDioxideSensor: 'Carbon Dioxide',
|
|
52
71
|
carbonMonoxideSensor: 'Carbon Monoxide',
|
|
72
|
+
celsius: '°C',
|
|
53
73
|
closed: 'Closed',
|
|
54
74
|
contactSensor: 'Contact',
|
|
75
|
+
cool: 'Cool',
|
|
76
|
+
cron: 'Cron',
|
|
55
77
|
door: 'Door',
|
|
78
|
+
fahrenheit: '°F',
|
|
79
|
+
heat: 'Heat',
|
|
56
80
|
hours: 'Hours',
|
|
81
|
+
interval: 'Interval',
|
|
57
82
|
leakSensor: 'Leak',
|
|
58
83
|
lightbulb: 'Lightbulb',
|
|
59
84
|
lockMechanism: 'Lock',
|
|
@@ -68,6 +93,7 @@ const en = {
|
|
|
68
93
|
secured: 'Locked',
|
|
69
94
|
smokeSensor: 'Smoke',
|
|
70
95
|
switch: 'Switch',
|
|
96
|
+
thermostat: 'Thermostat',
|
|
71
97
|
unsecured: 'Unlocked',
|
|
72
98
|
window: 'Window',
|
|
73
99
|
windowCovering: 'Window Convering (Blinds)',
|
|
@@ -81,20 +107,24 @@ const en = {
|
|
|
81
107
|
commandOpen: 'Open Command',
|
|
82
108
|
commandLock: 'Lock Command',
|
|
83
109
|
commandUnlock: 'Unlock Command',
|
|
110
|
+
commandTemperature: 'Temperature Changed Command',
|
|
111
|
+
cron: 'Cron',
|
|
84
112
|
defaultBrightness: 'Default Brightness',
|
|
85
113
|
defaultPosition: 'Default Position',
|
|
86
114
|
defaultState: 'Default State',
|
|
115
|
+
defaultTemperature: 'Default Temperature',
|
|
87
116
|
delay: 'Delay',
|
|
88
117
|
disableLogging: 'Disable Logging',
|
|
89
118
|
groupName: 'Group Name (Beta)',
|
|
119
|
+
interval: 'Interval',
|
|
90
120
|
name: 'Name',
|
|
91
|
-
options: 'Additional Settings',
|
|
92
121
|
resetOnRestart: 'Reset on Restart',
|
|
93
|
-
timer: '
|
|
122
|
+
timer: 'Auto-Reset',
|
|
123
|
+
trigger: 'Auto-Trigger',
|
|
94
124
|
sensor: 'Attach Sensor',
|
|
95
125
|
type: 'Type',
|
|
96
126
|
units: 'Units',
|
|
97
|
-
random: '
|
|
127
|
+
random: 'Randomize',
|
|
98
128
|
},
|
|
99
129
|
},
|
|
100
130
|
sensor: {
|
package/dist/i18n/en.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.js","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,MAAM,EAAE,GAAG;IAET,SAAS,EAAE;QAET,eAAe,EAAE,2CAA2C,EAAE,gCAAgC;QAE9F,OAAO,EAAE;YACP,QAAQ,EAAE,qBAAqB,EAAE,iBAAiB;YAClD,KAAK,EAAE,8BAA8B,EAAE,iBAAiB;SACzD;QAED,SAAS,EAAE;YACT,UAAU,EAAE,qBAAqB,EAAE,yBAAyB;YAC5D,OAAO,EAAE,cAAc,EAAE,yBAAyB;SACnD;QAED,IAAI,EAAE;YACJ,OAAO,EAAE,cAAc,EAAE,iBAAiB;YAC1C,SAAS,EAAE,gBAAgB,EAAE,iBAAiB;SAC/C;QAED,KAAK,EAAE;YACL,OAAO,EAAE,UAAU,EAAE,iBAAiB;YACtC,QAAQ,EAAE,WAAW,EAAE,iBAAiB;SACzC;QAED,QAAQ,EAAE;YACR,MAAM,EAAE,cAAc,EAAE,iBAAiB;YACzC,IAAI,EAAE,YAAY,EAAE,iBAAiB;SACtC;QAED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iB;SAC1D;KACF;IAED,OAAO,EAAE;QACP,eAAe,EAAE,iFAAiF;QAClG,iBAAiB,EAAE,uCAAuC,EAAE,SAAS;QACrE,sBAAsB,EAAE,2CAA2C;QACnE,eAAe,EAAE,kHAAkH;QACnI,eAAe,EAAE,0DAA0D;QAC3E,eAAe,EAAE,+FAA+F;QAChH,YAAY,EAAE,uBAAuB;QACrC,eAAe,EAAE,qBAAqB;QACtC,kBAAkB,EAAE,sBAAsB;QAC1C,aAAa,EAAE,kBAAkB;QACjC,eAAe,EAAE,+BAA+B,EAAE,iBAAiB;QACnE,OAAO,EAAE;YACP,4GAA4G;YAC5G,8EAA8E;YAC9E,4EAA4E;YAC5E,qHAAqH;SACtH;KACF;CACF,CAAC;AAEF,eAAe,EAAE,CAAC"}
|
package/dist/i18n/i18n.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare function setLanguage(i18nLang: string): void;
|
|
|
9
9
|
export declare function getAllTranslations(): Translation;
|
|
10
10
|
declare const translations: {
|
|
11
11
|
accessory: {
|
|
12
|
+
invalidCron: string;
|
|
12
13
|
missingRequired: string;
|
|
13
14
|
command: {
|
|
14
15
|
executed: string;
|
|
@@ -30,6 +31,15 @@ declare const translations: {
|
|
|
30
31
|
closed: string;
|
|
31
32
|
open: string;
|
|
32
33
|
};
|
|
34
|
+
thermostat: {
|
|
35
|
+
auto: string;
|
|
36
|
+
cool: string;
|
|
37
|
+
heat: string;
|
|
38
|
+
off: string;
|
|
39
|
+
temperatureC: string;
|
|
40
|
+
temperatureF: string;
|
|
41
|
+
unsupportedFunction: string;
|
|
42
|
+
};
|
|
33
43
|
timer: {
|
|
34
44
|
cancel: string;
|
|
35
45
|
reset: string;
|
|
@@ -37,6 +47,12 @@ declare const translations: {
|
|
|
37
47
|
setMinutes: string;
|
|
38
48
|
setHours: string;
|
|
39
49
|
};
|
|
50
|
+
trigger: {
|
|
51
|
+
cron: string;
|
|
52
|
+
intervalSeconds: string;
|
|
53
|
+
intervalMinutes: string;
|
|
54
|
+
intervalHours: string;
|
|
55
|
+
};
|
|
40
56
|
};
|
|
41
57
|
config: {
|
|
42
58
|
migrate: string;
|
|
@@ -53,16 +69,25 @@ declare const translations: {
|
|
|
53
69
|
no: string;
|
|
54
70
|
description: {
|
|
55
71
|
commands: string;
|
|
72
|
+
cron: string;
|
|
56
73
|
random: string;
|
|
57
74
|
timer: string;
|
|
75
|
+
trigger: string;
|
|
58
76
|
};
|
|
59
77
|
enumNames: {
|
|
78
|
+
auto: string;
|
|
60
79
|
carbonDioxideSensor: string;
|
|
61
80
|
carbonMonoxideSensor: string;
|
|
81
|
+
celsius: string;
|
|
62
82
|
closed: string;
|
|
63
83
|
contactSensor: string;
|
|
84
|
+
cool: string;
|
|
85
|
+
cron: string;
|
|
64
86
|
door: string;
|
|
87
|
+
fahrenheit: string;
|
|
88
|
+
heat: string;
|
|
65
89
|
hours: string;
|
|
90
|
+
interval: string;
|
|
66
91
|
leakSensor: string;
|
|
67
92
|
lightbulb: string;
|
|
68
93
|
lockMechanism: string;
|
|
@@ -77,6 +102,7 @@ declare const translations: {
|
|
|
77
102
|
secured: string;
|
|
78
103
|
smokeSensor: string;
|
|
79
104
|
switch: string;
|
|
105
|
+
thermostat: string;
|
|
80
106
|
unsecured: string;
|
|
81
107
|
window: string;
|
|
82
108
|
windowCovering: string;
|
|
@@ -90,16 +116,20 @@ declare const translations: {
|
|
|
90
116
|
commandOpen: string;
|
|
91
117
|
commandLock: string;
|
|
92
118
|
commandUnlock: string;
|
|
119
|
+
commandTemperature: string;
|
|
120
|
+
cron: string;
|
|
93
121
|
defaultBrightness: string;
|
|
94
122
|
defaultPosition: string;
|
|
95
123
|
defaultState: string;
|
|
124
|
+
defaultTemperature: string;
|
|
96
125
|
delay: string;
|
|
97
126
|
disableLogging: string;
|
|
98
127
|
groupName: string;
|
|
128
|
+
interval: string;
|
|
99
129
|
name: string;
|
|
100
|
-
options: string;
|
|
101
130
|
resetOnRestart: string;
|
|
102
131
|
timer: string;
|
|
132
|
+
trigger: string;
|
|
103
133
|
sensor: string;
|
|
104
134
|
type: string;
|
|
105
135
|
units: string;
|
package/dist/i18n/template.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const REPLACE_THIS_WITH_ISO_CODE: {
|
|
2
2
|
accessory: {
|
|
3
|
+
invalidCron: string;
|
|
3
4
|
missingRequired: string;
|
|
4
5
|
command: {
|
|
5
6
|
executed: string;
|
|
@@ -21,6 +22,15 @@ declare const REPLACE_THIS_WITH_ISO_CODE: {
|
|
|
21
22
|
closed: string;
|
|
22
23
|
open: string;
|
|
23
24
|
};
|
|
25
|
+
thermostat: {
|
|
26
|
+
auto: string;
|
|
27
|
+
cool: string;
|
|
28
|
+
heat: string;
|
|
29
|
+
off: string;
|
|
30
|
+
temperatureC: string;
|
|
31
|
+
temperatureF: string;
|
|
32
|
+
unsupportedFunction: string;
|
|
33
|
+
};
|
|
24
34
|
timer: {
|
|
25
35
|
cancel: string;
|
|
26
36
|
reset: string;
|
|
@@ -28,6 +38,12 @@ declare const REPLACE_THIS_WITH_ISO_CODE: {
|
|
|
28
38
|
setMinutes: string;
|
|
29
39
|
setHours: string;
|
|
30
40
|
};
|
|
41
|
+
trigger: {
|
|
42
|
+
cron: string;
|
|
43
|
+
intervalSeconds: string;
|
|
44
|
+
intervalMinutes: string;
|
|
45
|
+
intervalHours: string;
|
|
46
|
+
};
|
|
31
47
|
};
|
|
32
48
|
config: {
|
|
33
49
|
migrate: string;
|
|
@@ -44,16 +60,25 @@ declare const REPLACE_THIS_WITH_ISO_CODE: {
|
|
|
44
60
|
no: string;
|
|
45
61
|
description: {
|
|
46
62
|
commands: string;
|
|
63
|
+
cron: string;
|
|
47
64
|
random: string;
|
|
48
65
|
timer: string;
|
|
66
|
+
trigger: string;
|
|
49
67
|
};
|
|
50
68
|
enumNames: {
|
|
69
|
+
auto: string;
|
|
51
70
|
carbonDioxideSensor: string;
|
|
52
71
|
carbonMonoxideSensor: string;
|
|
72
|
+
celsius: string;
|
|
53
73
|
closed: string;
|
|
54
74
|
contactSensor: string;
|
|
75
|
+
cool: string;
|
|
76
|
+
cron: string;
|
|
55
77
|
door: string;
|
|
78
|
+
fahrenheit: string;
|
|
79
|
+
heat: string;
|
|
56
80
|
hours: string;
|
|
81
|
+
interval: string;
|
|
57
82
|
leakSensor: string;
|
|
58
83
|
lightbulb: string;
|
|
59
84
|
lockMechanism: string;
|
|
@@ -68,6 +93,7 @@ declare const REPLACE_THIS_WITH_ISO_CODE: {
|
|
|
68
93
|
secured: string;
|
|
69
94
|
smokeSensor: string;
|
|
70
95
|
switch: string;
|
|
96
|
+
thermostat: string;
|
|
71
97
|
unsecured: string;
|
|
72
98
|
window: string;
|
|
73
99
|
windowCovering: string;
|
|
@@ -81,16 +107,20 @@ declare const REPLACE_THIS_WITH_ISO_CODE: {
|
|
|
81
107
|
commandOpen: string;
|
|
82
108
|
commandLock: string;
|
|
83
109
|
commandUnlock: string;
|
|
110
|
+
commandTemperature: string;
|
|
111
|
+
cron: string;
|
|
84
112
|
defaultBrightness: string;
|
|
85
113
|
defaultPosition: string;
|
|
86
114
|
defaultState: string;
|
|
115
|
+
defaultTemperature: string;
|
|
87
116
|
delay: string;
|
|
88
117
|
disableLogging: string;
|
|
89
118
|
groupName: string;
|
|
119
|
+
interval: string;
|
|
90
120
|
name: string;
|
|
91
|
-
options: string;
|
|
92
121
|
resetOnRestart: string;
|
|
93
122
|
timer: string;
|
|
123
|
+
trigger: string;
|
|
94
124
|
sensor: string;
|
|
95
125
|
type: string;
|
|
96
126
|
units: string;
|
package/dist/i18n/zz.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const zz: {
|
|
2
2
|
accessory: {
|
|
3
|
+
invalidCron: string;
|
|
3
4
|
missingRequired: string;
|
|
4
5
|
command: {
|
|
5
6
|
executed: string;
|
|
@@ -21,6 +22,15 @@ declare const zz: {
|
|
|
21
22
|
closed: string;
|
|
22
23
|
open: string;
|
|
23
24
|
};
|
|
25
|
+
thermostat: {
|
|
26
|
+
auto: string;
|
|
27
|
+
cool: string;
|
|
28
|
+
heat: string;
|
|
29
|
+
off: string;
|
|
30
|
+
temperatureC: string;
|
|
31
|
+
temperatureF: string;
|
|
32
|
+
unsupportedFunction: string;
|
|
33
|
+
};
|
|
24
34
|
timer: {
|
|
25
35
|
cancel: string;
|
|
26
36
|
reset: string;
|
|
@@ -28,6 +38,12 @@ declare const zz: {
|
|
|
28
38
|
setMinutes: string;
|
|
29
39
|
setHours: string;
|
|
30
40
|
};
|
|
41
|
+
trigger: {
|
|
42
|
+
cron: string;
|
|
43
|
+
intervalSeconds: string;
|
|
44
|
+
intervalMinutes: string;
|
|
45
|
+
intervalHours: string;
|
|
46
|
+
};
|
|
31
47
|
};
|
|
32
48
|
config: {
|
|
33
49
|
migrate: string;
|
|
@@ -44,16 +60,25 @@ declare const zz: {
|
|
|
44
60
|
no: string;
|
|
45
61
|
description: {
|
|
46
62
|
commands: string;
|
|
63
|
+
cron: string;
|
|
47
64
|
random: string;
|
|
48
65
|
timer: string;
|
|
66
|
+
trigger: string;
|
|
49
67
|
};
|
|
50
68
|
enumNames: {
|
|
69
|
+
auto: string;
|
|
51
70
|
carbonDioxideSensor: string;
|
|
52
71
|
carbonMonoxideSensor: string;
|
|
72
|
+
celsius: string;
|
|
53
73
|
closed: string;
|
|
54
74
|
contactSensor: string;
|
|
75
|
+
cool: string;
|
|
76
|
+
cron: string;
|
|
55
77
|
door: string;
|
|
78
|
+
fahrenheit: string;
|
|
79
|
+
heat: string;
|
|
56
80
|
hours: string;
|
|
81
|
+
interval: string;
|
|
57
82
|
leakSensor: string;
|
|
58
83
|
lightbulb: string;
|
|
59
84
|
lockMechanism: string;
|
|
@@ -68,6 +93,7 @@ declare const zz: {
|
|
|
68
93
|
secured: string;
|
|
69
94
|
smokeSensor: string;
|
|
70
95
|
switch: string;
|
|
96
|
+
thermostat: string;
|
|
71
97
|
unsecured: string;
|
|
72
98
|
window: string;
|
|
73
99
|
windowCovering: string;
|
|
@@ -81,16 +107,20 @@ declare const zz: {
|
|
|
81
107
|
commandOpen: string;
|
|
82
108
|
commandLock: string;
|
|
83
109
|
commandUnlock: string;
|
|
110
|
+
commandTemperature: string;
|
|
111
|
+
cron: string;
|
|
84
112
|
defaultBrightness: string;
|
|
85
113
|
defaultPosition: string;
|
|
86
114
|
defaultState: string;
|
|
115
|
+
defaultTemperature: string;
|
|
87
116
|
delay: string;
|
|
88
117
|
disableLogging: string;
|
|
89
118
|
groupName: string;
|
|
119
|
+
interval: string;
|
|
90
120
|
name: string;
|
|
91
|
-
options: string;
|
|
92
121
|
resetOnRestart: string;
|
|
93
122
|
timer: string;
|
|
123
|
+
trigger: string;
|
|
94
124
|
sensor: string;
|
|
95
125
|
type: string;
|
|
96
126
|
units: string;
|
package/dist/model/timer.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { Log } from '../tools/log.js';
|
|
2
1
|
import { TimerConfig } from './types.js';
|
|
2
|
+
import { Log } from '../tools/log.js';
|
|
3
3
|
export declare class Timer {
|
|
4
|
+
private readonly config;
|
|
4
5
|
private readonly caller;
|
|
5
|
-
private readonly log
|
|
6
|
-
private
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
private readonly log;
|
|
7
|
+
private readonly disableLogging;
|
|
8
|
+
static new(config: TimerConfig, caller: string, log: Log, disableLogging: boolean): Timer | undefined;
|
|
9
|
+
private timeout?;
|
|
10
|
+
private constructor();
|
|
11
|
+
start(callback: () => Promise<void>): void;
|
|
9
12
|
cancel(): void;
|
|
10
13
|
teardown(): void;
|
|
11
14
|
private reset;
|
|
15
|
+
private logIfDesired;
|
|
12
16
|
}
|
package/dist/model/timer.js
CHANGED
|
@@ -1,53 +1,50 @@
|
|
|
1
1
|
import { strings } from '../i18n/i18n.js';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const MINUTE = 60 * SECOND;
|
|
5
|
-
const HOUR = 60 * MINUTE;
|
|
2
|
+
import { HOUR, MINUTE, SECOND, toMilliseconds } from '../tools/time.js';
|
|
3
|
+
import { assert } from '../tools/validation.js';
|
|
6
4
|
export class Timer {
|
|
5
|
+
config;
|
|
7
6
|
caller;
|
|
8
7
|
log;
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
disableLogging;
|
|
9
|
+
static new(config, caller, log, disableLogging) {
|
|
10
|
+
if (!assert(log, caller, config, 'delay', 'units')) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
return new Timer(config, caller, log, disableLogging);
|
|
14
|
+
}
|
|
15
|
+
timeout;
|
|
16
|
+
constructor(config, caller, log, disableLogging) {
|
|
17
|
+
this.config = config;
|
|
11
18
|
this.caller = caller;
|
|
12
19
|
this.log = log;
|
|
20
|
+
this.disableLogging = disableLogging;
|
|
13
21
|
}
|
|
14
|
-
start(
|
|
15
|
-
if (this.
|
|
16
|
-
this.
|
|
22
|
+
start(callback) {
|
|
23
|
+
if (this.timeout) {
|
|
24
|
+
this.logIfDesired(strings.accessory.timer.reset);
|
|
17
25
|
this.reset();
|
|
18
26
|
}
|
|
19
|
-
let delay = config.delay;
|
|
20
|
-
|
|
21
|
-
case TimeUnits.SECONDS:
|
|
22
|
-
delay *= SECOND;
|
|
23
|
-
break;
|
|
24
|
-
case TimeUnits.MINUTES:
|
|
25
|
-
delay *= MINUTE;
|
|
26
|
-
break;
|
|
27
|
-
case TimeUnits.HOURS:
|
|
28
|
-
delay *= HOUR;
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
if (config.random) {
|
|
27
|
+
let delay = toMilliseconds(this.config.delay, this.config.units);
|
|
28
|
+
if (this.config.random) {
|
|
32
29
|
delay = Math.floor(Math.max(SECOND, Math.random() * delay));
|
|
33
30
|
}
|
|
34
31
|
if (delay < MINUTE) {
|
|
35
|
-
this.
|
|
32
|
+
this.logIfDesired(strings.accessory.timer.setSeconds, Math.round(delay / SECOND));
|
|
36
33
|
}
|
|
37
34
|
else if (delay < HOUR) {
|
|
38
|
-
this.
|
|
35
|
+
this.logIfDesired(strings.accessory.timer.setMinutes, Math.round(delay / MINUTE));
|
|
39
36
|
}
|
|
40
37
|
else {
|
|
41
|
-
this.
|
|
38
|
+
this.logIfDesired(strings.accessory.timer.setHours, Math.round(delay / HOUR));
|
|
42
39
|
}
|
|
43
|
-
this.
|
|
40
|
+
this.timeout = setTimeout(async () => {
|
|
44
41
|
this.reset();
|
|
45
42
|
await callback();
|
|
46
43
|
}, delay);
|
|
47
44
|
}
|
|
48
45
|
cancel() {
|
|
49
|
-
if (this.
|
|
50
|
-
this.
|
|
46
|
+
if (this.timeout) {
|
|
47
|
+
this.logIfDesired(strings.accessory.timer.cancel);
|
|
51
48
|
this.reset();
|
|
52
49
|
}
|
|
53
50
|
}
|
|
@@ -55,8 +52,14 @@ export class Timer {
|
|
|
55
52
|
this.reset();
|
|
56
53
|
}
|
|
57
54
|
reset() {
|
|
58
|
-
clearTimeout(this.
|
|
59
|
-
this.
|
|
55
|
+
clearTimeout(this.timeout);
|
|
56
|
+
this.timeout = undefined;
|
|
57
|
+
}
|
|
58
|
+
logIfDesired(message, ...parameters) {
|
|
59
|
+
if (this.disableLogging) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
this.log.always(message, this.caller, ...parameters);
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
65
|
//# sourceMappingURL=timer.js.map
|
package/dist/model/timer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timer.js","sourceRoot":"","sources":["../../src/model/timer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"timer.js","sourceRoot":"","sources":["../../src/model/timer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG1C,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE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ggerConfig } from './types.js';
|
|
2
|
+
import { Log } from '../tools/log.js';
|
|
3
|
+
export declare class Trigger {
|
|
4
|
+
private readonly trigger;
|
|
5
|
+
private readonly caller;
|
|
6
|
+
private readonly log;
|
|
7
|
+
private readonly disableLogging;
|
|
8
|
+
private readonly callback;
|
|
9
|
+
static new(trigger: TriggerConfig, caller: string, log: Log, disableLogging: boolean, callback: () => Promise<void>): Trigger | undefined;
|
|
10
|
+
private timeout?;
|
|
11
|
+
private cronjob?;
|
|
12
|
+
private constructor();
|
|
13
|
+
private startTimeout;
|
|
14
|
+
private startCron;
|
|
15
|
+
teardown(): void;
|
|
16
|
+
private resetTimeout;
|
|
17
|
+
private logIfDesired;
|
|
18
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { CronJob, validateCronExpression } from 'cron';
|
|
2
|
+
import { TriggerType } from './types.js';
|
|
3
|
+
import { strings } from '../i18n/i18n.js';
|
|
4
|
+
import { HOUR, MINUTE, SECOND, toMilliseconds } from '../tools/time.js';
|
|
5
|
+
import { assert } from '../tools/validation.js';
|
|
6
|
+
export class Trigger {
|
|
7
|
+
trigger;
|
|
8
|
+
caller;
|
|
9
|
+
log;
|
|
10
|
+
disableLogging;
|
|
11
|
+
callback;
|
|
12
|
+
static new(trigger, caller, log, disableLogging, callback) {
|
|
13
|
+
if (!assert(log, caller, trigger, 'type')) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
switch (trigger.type) {
|
|
17
|
+
case TriggerType.INTERVAL:
|
|
18
|
+
if (!assert(log, caller, trigger, 'interval', 'units')) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
break;
|
|
22
|
+
case TriggerType.CRON:
|
|
23
|
+
if (!assert(log, caller, trigger, 'cron')) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return new Trigger(trigger, caller, log, disableLogging, callback);
|
|
28
|
+
}
|
|
29
|
+
timeout;
|
|
30
|
+
cronjob;
|
|
31
|
+
constructor(trigger, caller, log, disableLogging, callback) {
|
|
32
|
+
this.trigger = trigger;
|
|
33
|
+
this.caller = caller;
|
|
34
|
+
this.log = log;
|
|
35
|
+
this.disableLogging = disableLogging;
|
|
36
|
+
this.callback = callback;
|
|
37
|
+
switch (this.trigger.type) {
|
|
38
|
+
case TriggerType.INTERVAL:
|
|
39
|
+
this.startTimeout();
|
|
40
|
+
break;
|
|
41
|
+
case TriggerType.CRON:
|
|
42
|
+
this.startCron();
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
startTimeout() {
|
|
47
|
+
this.resetTimeout();
|
|
48
|
+
let delay = toMilliseconds(this.trigger.interval, this.trigger.units);
|
|
49
|
+
if (this.trigger.random) {
|
|
50
|
+
delay = Math.floor(Math.max(SECOND, Math.random() * delay));
|
|
51
|
+
}
|
|
52
|
+
if (delay < MINUTE) {
|
|
53
|
+
this.logIfDesired(strings.accessory.trigger.intervalSeconds, Math.round(delay / SECOND));
|
|
54
|
+
}
|
|
55
|
+
else if (delay < HOUR) {
|
|
56
|
+
this.logIfDesired(strings.accessory.trigger.intervalMinutes, Math.round(delay / MINUTE));
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
this.logIfDesired(strings.accessory.trigger.intervalHours, Math.round(delay / HOUR));
|
|
60
|
+
}
|
|
61
|
+
this.timeout = setTimeout(async () => {
|
|
62
|
+
this.resetTimeout();
|
|
63
|
+
await this.callback();
|
|
64
|
+
this.startTimeout();
|
|
65
|
+
}, delay);
|
|
66
|
+
}
|
|
67
|
+
startCron() {
|
|
68
|
+
const cron = this.trigger.cron;
|
|
69
|
+
if (!validateCronExpression(cron).valid) {
|
|
70
|
+
this.log.error(strings.accessory.invalidCron, this.caller, `'${this.trigger.cron}'`);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
this.logIfDesired(strings.accessory.trigger.cron, this.caller);
|
|
74
|
+
this.cronjob = new CronJob(this.trigger.cron, this.callback);
|
|
75
|
+
this.cronjob.start();
|
|
76
|
+
}
|
|
77
|
+
teardown() {
|
|
78
|
+
this.resetTimeout();
|
|
79
|
+
this.cronjob?.stop();
|
|
80
|
+
}
|
|
81
|
+
resetTimeout() {
|
|
82
|
+
clearTimeout(this.timeout);
|
|
83
|
+
this.timeout = undefined;
|
|
84
|
+
}
|
|
85
|
+
logIfDesired(message, ...parameters) {
|
|
86
|
+
if (this.disableLogging) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
this.log.always(message, this.caller, ...parameters);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=trigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../src/model/trigger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,MAAM,CAAC;AAEvD,OAAO,EAAiB,WAAW,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG1C,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,MAAM,OAAO,OAAO;IA0BC;IACA;IACA;IACA;IACA;IA5BnB,MAAM,CAAC,GAAG,CAAC,OAAsB,EAAE,MAAc,EAAG,GAAQ,EAAE,cAAuB,EAAE,QAA8B;QAEnH,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;YAC1C,OAAO;QACT,CAAC;QAED,QAAO,OAAO,CAAC,IAAI,EAAE,CAAC;YACtB,KAAK,WAAW,CAAC,QAAQ;gBACvB,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,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