iobroker-ucl 1.4.9 → 1.4.10

Sign up to get free protection for your applications and to get access to all the features.
package/alexa.js CHANGED
@@ -1,103 +1,103 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AlexaInputConverter = void 0;
4
- var AlexaInputConverter = /** @class */ (function () {
5
- function AlexaInputConverter(adapter, value, logContext, callback) {
6
- var _this = this;
7
- this.actionTurnOn = false;
8
- this.actionTurnOff = false;
9
- this.actionChangeLevel = false;
10
- this.actionChangeColor = false;
11
- this.actionChangeCT = false;
12
- this.smartName = "?";
13
- this.levelNew = -1;
14
- this.hueNew = -1;
15
- this.ctNew = -1;
16
- setTimeout(function () {
17
- _this.adapter = adapter;
18
- _this.value = value;
19
- if (_this.value.toString().endsWith('.level')) {
20
- _this.smartName = _this.value.replace("0_userdata.0.alexa.", "").replace(".level", "");
21
- _this.levelNew = _this.adapter.getState(value).val;
22
- if (_this.levelNew == 100) {
23
- _this.actionTurnOn = true;
24
- }
25
- else if (_this.levelNew == 0) {
26
- _this.actionTurnOff = true;
27
- }
28
- else {
29
- _this.actionChangeLevel = true;
30
- }
31
- }
32
- else if (value.endsWith('.hue')) {
33
- _this.smartName = value.replace("0_userdata.0.alexa.", "").replace(".hue", "");
34
- _this.hueNew = _this.adapter.getState(_this.value).val;
35
- _this.actionChangeColor = true;
36
- }
37
- else if (value.endsWith('.ct')) {
38
- _this.smartName = value.replace("0_userdata.0.alexa.", "").replace(".ct", "");
39
- _this.ctNew = _this.adapter.getState(value).val;
40
- _this.actionChangeCT = true;
41
- }
42
- adapter.log("");
43
- adapter.log(">>> ALEXA (" + logContext + ") >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
44
- adapter.log(" Value : " + _this.value);
45
- adapter.log(" smartName : " + _this.smartName);
46
- adapter.log(" actionTurnOn : " + _this.actionTurnOn);
47
- adapter.log(" actionTurnOff : " + _this.actionTurnOff);
48
- if (_this.actionChangeLevel) {
49
- adapter.log(" actionChangeLevel: " + _this.actionChangeLevel + " (" + _this.levelNew + ")");
50
- }
51
- else {
52
- adapter.log(" actionChangeLevel: " + _this.actionChangeLevel);
53
- }
54
- if (_this.actionChangeColor) {
55
- adapter.log(" actionChangeColor: " + _this.actionChangeColor + " (" + _this.hueNew + ")");
56
- }
57
- else {
58
- adapter.log(" actionChangeColor: " + _this.actionChangeColor);
59
- }
60
- if (_this.actionChangeCT) {
61
- adapter.log(" actionChangeCT: " + _this.actionChangeCT + " (" + _this.ctNew + ")");
62
- }
63
- else {
64
- adapter.log(" actionChangeCT: " + _this.actionChangeCT);
65
- }
66
- adapter.log("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
67
- adapter.log("return now");
68
- callback(_this);
69
- }, 75);
70
- }
71
- AlexaInputConverter.prototype.isActionTurnedOn = function () {
72
- return this.actionTurnOn;
73
- };
74
- AlexaInputConverter.prototype.isActionTurnedOff = function () {
75
- return this.actionTurnOff;
76
- };
77
- AlexaInputConverter.prototype.isActionChangedLevel = function () {
78
- return this.actionChangeLevel;
79
- };
80
- AlexaInputConverter.prototype.isActionChangedColor = function () {
81
- return this.actionChangeColor;
82
- };
83
- AlexaInputConverter.prototype.isActionChangedColorTemperature = function () {
84
- return this.actionChangeCT;
85
- };
86
- AlexaInputConverter.prototype.getSmartName = function () {
87
- return this.smartName;
88
- };
89
- AlexaInputConverter.prototype.getLevel = function () {
90
- return this.levelNew;
91
- };
92
- AlexaInputConverter.prototype.getHue = function () {
93
- return this.hueNew;
94
- };
95
- AlexaInputConverter.prototype.getColorTemperature = function () {
96
- return this.ctNew;
97
- };
98
- return AlexaInputConverter;
99
- }());
100
- exports.AlexaInputConverter = AlexaInputConverter;
101
- module.exports = {
102
- AlexaInputConverter: AlexaInputConverter
103
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AlexaInputConverter = void 0;
4
+ var AlexaInputConverter = /** @class */ (function () {
5
+ function AlexaInputConverter(adapter, value, logContext, callback) {
6
+ var _this = this;
7
+ this.actionTurnOn = false;
8
+ this.actionTurnOff = false;
9
+ this.actionChangeLevel = false;
10
+ this.actionChangeColor = false;
11
+ this.actionChangeCT = false;
12
+ this.smartName = "?";
13
+ this.levelNew = -1;
14
+ this.hueNew = -1;
15
+ this.ctNew = -1;
16
+ setTimeout(function () {
17
+ _this.adapter = adapter;
18
+ _this.value = value;
19
+ if (_this.value.toString().endsWith('.level')) {
20
+ _this.smartName = _this.value.replace("0_userdata.0.alexa.", "").replace(".level", "");
21
+ _this.levelNew = _this.adapter.getState(value).val;
22
+ if (_this.levelNew == 100) {
23
+ _this.actionTurnOn = true;
24
+ }
25
+ else if (_this.levelNew == 0) {
26
+ _this.actionTurnOff = true;
27
+ }
28
+ else {
29
+ _this.actionChangeLevel = true;
30
+ }
31
+ }
32
+ else if (value.endsWith('.hue')) {
33
+ _this.smartName = value.replace("0_userdata.0.alexa.", "").replace(".hue", "");
34
+ _this.hueNew = _this.adapter.getState(_this.value).val;
35
+ _this.actionChangeColor = true;
36
+ }
37
+ else if (value.endsWith('.ct')) {
38
+ _this.smartName = value.replace("0_userdata.0.alexa.", "").replace(".ct", "");
39
+ _this.ctNew = _this.adapter.getState(value).val;
40
+ _this.actionChangeCT = true;
41
+ }
42
+ adapter.log("");
43
+ adapter.log(">>> ALEXA (" + logContext + ") >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
44
+ adapter.log(" Value : " + _this.value);
45
+ adapter.log(" smartName : " + _this.smartName);
46
+ adapter.log(" actionTurnOn : " + _this.actionTurnOn);
47
+ adapter.log(" actionTurnOff : " + _this.actionTurnOff);
48
+ if (_this.actionChangeLevel) {
49
+ adapter.log(" actionChangeLevel: " + _this.actionChangeLevel + " (" + _this.levelNew + ")");
50
+ }
51
+ else {
52
+ adapter.log(" actionChangeLevel: " + _this.actionChangeLevel);
53
+ }
54
+ if (_this.actionChangeColor) {
55
+ adapter.log(" actionChangeColor: " + _this.actionChangeColor + " (" + _this.hueNew + ")");
56
+ }
57
+ else {
58
+ adapter.log(" actionChangeColor: " + _this.actionChangeColor);
59
+ }
60
+ if (_this.actionChangeCT) {
61
+ adapter.log(" actionChangeCT: " + _this.actionChangeCT + " (" + _this.ctNew + ")");
62
+ }
63
+ else {
64
+ adapter.log(" actionChangeCT: " + _this.actionChangeCT);
65
+ }
66
+ adapter.log("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
67
+ adapter.log("return now");
68
+ callback(_this);
69
+ }, 75);
70
+ }
71
+ AlexaInputConverter.prototype.isActionTurnedOn = function () {
72
+ return this.actionTurnOn;
73
+ };
74
+ AlexaInputConverter.prototype.isActionTurnedOff = function () {
75
+ return this.actionTurnOff;
76
+ };
77
+ AlexaInputConverter.prototype.isActionChangedLevel = function () {
78
+ return this.actionChangeLevel;
79
+ };
80
+ AlexaInputConverter.prototype.isActionChangedColor = function () {
81
+ return this.actionChangeColor;
82
+ };
83
+ AlexaInputConverter.prototype.isActionChangedColorTemperature = function () {
84
+ return this.actionChangeCT;
85
+ };
86
+ AlexaInputConverter.prototype.getSmartName = function () {
87
+ return this.smartName;
88
+ };
89
+ AlexaInputConverter.prototype.getLevel = function () {
90
+ return this.levelNew;
91
+ };
92
+ AlexaInputConverter.prototype.getHue = function () {
93
+ return this.hueNew;
94
+ };
95
+ AlexaInputConverter.prototype.getColorTemperature = function () {
96
+ return this.ctNew;
97
+ };
98
+ return AlexaInputConverter;
99
+ }());
100
+ exports.AlexaInputConverter = AlexaInputConverter;
101
+ module.exports = {
102
+ AlexaInputConverter: AlexaInputConverter
103
+ };
package/camera.js CHANGED
@@ -1,61 +1,60 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sendToPictureGarageToTelegram = exports.sendToPictureDoorbellToTelegram = exports.sendToPictureHaustuereToTelegram = exports.sendToPictureSeiteToTelegram = exports.sendToPictureGartenToTelegram = void 0;
4
- var fs = require('fs');
5
- var axios = require('axios');
6
- function sendToPictureGartenToTelegram(adapter, caption) {
7
- axios.get("http://192.168.178.188/snap.jpeg", { responseType: 'arraybuffer' }).then(function (response) {
8
- var filename = "/opt/iobroker/telegramm.jpeg";
9
- fs.writeFile(filename, response.data, 'binary', function (err) {
10
- if (err == null) {
11
- adapter.sendTo('telegram.0', { text: "/opt/iobroker/telegramm.jpeg", caption: caption });
12
- }
13
- });
14
- });
15
- }
16
- exports.sendToPictureGartenToTelegram = sendToPictureGartenToTelegram;
17
- function sendToPictureSeiteToTelegram(adapter, caption) {
18
- axios.get("http://192.168.178.38/snap.jpeg", { responseType: 'arraybuffer' }).then(function (response) {
19
- var filename = "/opt/iobroker/telegramm.jpeg";
20
- fs.writeFile(filename, response.data, 'binary', function (err) {
21
- if (err == null) {
22
- adapter.sendTo('telegram.0', { text: "/opt/iobroker/telegramm.jpeg", caption: caption });
23
- }
24
- });
25
- });
26
- }
27
- exports.sendToPictureSeiteToTelegram = sendToPictureSeiteToTelegram;
28
- function sendToPictureHaustuereToTelegram(adapter, caption) {
29
- axios.get("http://192.168.178.173/snap.jpeg", { responseType: 'arraybuffer' }).then(function (response) {
30
- var filename = "/opt/iobroker/telegramm.jpeg";
31
- fs.writeFile(filename, response.data, 'binary', function (err) {
32
- if (err == null) {
33
- adapter.sendTo('telegram.0', { text: "/opt/iobroker/telegramm.jpeg", caption: caption });
34
- }
35
- });
36
- });
37
- }
38
- exports.sendToPictureHaustuereToTelegram = sendToPictureHaustuereToTelegram;
39
- function sendToPictureDoorbellToTelegram(adapter, caption) {
40
- axios.get("http://192.168.178.90/snap.jpeg", { responseType: 'arraybuffer' }).then(function (response) {
41
- var filename = "/opt/iobroker/telegramm.jpeg";
42
- fs.writeFile(filename, response.data, 'binary', function (err) {
43
- if (err == null) {
44
- adapter.sendTo('telegram.0', { text: "/opt/iobroker/telegramm.jpeg", caption: caption });
45
- }
46
- });
47
- });
48
- }
49
- exports.sendToPictureDoorbellToTelegram = sendToPictureDoorbellToTelegram;
50
- function sendToPictureGarageToTelegram(adapter, caption) {
51
- axios.get("http://192.168.178.166/snap.jpeg", { responseType: 'arraybuffer' }).then(function (response) {
52
- var filename = "/opt/iobroker/telegramm.jpeg";
53
- fs.writeFile(filename, response.data, 'binary', function (err) {
54
- if (err == null) {
55
- adapter.sendTo('telegram.0', { text: "/opt/iobroker/telegramm.jpeg", caption: caption });
56
- }
57
- });
58
- });
59
- }
60
- exports.sendToPictureGarageToTelegram = sendToPictureGarageToTelegram;
61
- module.exports = { sendToPictureGartenToTelegram: sendToPictureGartenToTelegram, sendToPictureSeiteToTelegram: sendToPictureSeiteToTelegram, sendToPictureHaustuereToTelegram: sendToPictureHaustuereToTelegram, sendToPictureDoorbellToTelegram: sendToPictureDoorbellToTelegram, sendToPictureGarageToTelegram: sendToPictureGarageToTelegram };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendToPictureGartenToTelegram = sendToPictureGartenToTelegram;
4
+ exports.sendToPictureSeiteToTelegram = sendToPictureSeiteToTelegram;
5
+ exports.sendToPictureHaustuereToTelegram = sendToPictureHaustuereToTelegram;
6
+ exports.sendToPictureDoorbellToTelegram = sendToPictureDoorbellToTelegram;
7
+ exports.sendToPictureGarageToTelegram = sendToPictureGarageToTelegram;
8
+ var fs = require('fs');
9
+ var axios = require('axios');
10
+ function sendToPictureGartenToTelegram(adapter, caption) {
11
+ axios.get("http://192.168.178.188/snap.jpeg", { responseType: 'arraybuffer' }).then(function (response) {
12
+ var filename = "/opt/iobroker/telegramm.jpeg";
13
+ fs.writeFile(filename, response.data, 'binary', function (err) {
14
+ if (err == null) {
15
+ adapter.sendTo('telegram.0', { text: "/opt/iobroker/telegramm.jpeg", caption: caption });
16
+ }
17
+ });
18
+ });
19
+ }
20
+ function sendToPictureSeiteToTelegram(adapter, caption) {
21
+ axios.get("http://192.168.178.38/snap.jpeg", { responseType: 'arraybuffer' }).then(function (response) {
22
+ var filename = "/opt/iobroker/telegramm.jpeg";
23
+ fs.writeFile(filename, response.data, 'binary', function (err) {
24
+ if (err == null) {
25
+ adapter.sendTo('telegram.0', { text: "/opt/iobroker/telegramm.jpeg", caption: caption });
26
+ }
27
+ });
28
+ });
29
+ }
30
+ function sendToPictureHaustuereToTelegram(adapter, caption) {
31
+ axios.get("http://192.168.178.173/snap.jpeg", { responseType: 'arraybuffer' }).then(function (response) {
32
+ var filename = "/opt/iobroker/telegramm.jpeg";
33
+ fs.writeFile(filename, response.data, 'binary', function (err) {
34
+ if (err == null) {
35
+ adapter.sendTo('telegram.0', { text: "/opt/iobroker/telegramm.jpeg", caption: caption });
36
+ }
37
+ });
38
+ });
39
+ }
40
+ function sendToPictureDoorbellToTelegram(adapter, caption) {
41
+ axios.get("http://192.168.178.90/snap.jpeg", { responseType: 'arraybuffer' }).then(function (response) {
42
+ var filename = "/opt/iobroker/telegramm.jpeg";
43
+ fs.writeFile(filename, response.data, 'binary', function (err) {
44
+ if (err == null) {
45
+ adapter.sendTo('telegram.0', { text: "/opt/iobroker/telegramm.jpeg", caption: caption });
46
+ }
47
+ });
48
+ });
49
+ }
50
+ function sendToPictureGarageToTelegram(adapter, caption) {
51
+ axios.get("http://192.168.178.166/snap.jpeg", { responseType: 'arraybuffer' }).then(function (response) {
52
+ var filename = "/opt/iobroker/telegramm.jpeg";
53
+ fs.writeFile(filename, response.data, 'binary', function (err) {
54
+ if (err == null) {
55
+ adapter.sendTo('telegram.0', { text: "/opt/iobroker/telegramm.jpeg", caption: caption });
56
+ }
57
+ });
58
+ });
59
+ }
60
+ module.exports = { sendToPictureGartenToTelegram: sendToPictureGartenToTelegram, sendToPictureSeiteToTelegram: sendToPictureSeiteToTelegram, sendToPictureHaustuereToTelegram: sendToPictureHaustuereToTelegram, sendToPictureDoorbellToTelegram: sendToPictureDoorbellToTelegram, sendToPictureGarageToTelegram: sendToPictureGarageToTelegram };
package/date.js CHANGED
@@ -1,43 +1,43 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DateHelper = void 0;
4
- var DateHelper = /** @class */ (function () {
5
- function DateHelper() {
6
- }
7
- DateHelper.prototype.getCurrentWeekdayAsString = function () {
8
- var now = new Date();
9
- var weekday = now.getDay();
10
- return this.getWeekdayAsString(weekday);
11
- };
12
- DateHelper.prototype.getWeekdayAsString = function (weekday) {
13
- var weekdayAsString;
14
- if (weekday == 1) {
15
- weekdayAsString = "Montag";
16
- }
17
- else if (weekday == 2) {
18
- weekdayAsString = "Dienstag";
19
- }
20
- else if (weekday == 3) {
21
- weekdayAsString = "Mittwoch";
22
- }
23
- else if (weekday == 4) {
24
- weekdayAsString = "Donnerstag";
25
- }
26
- else if (weekday == 5) {
27
- weekdayAsString = "Freitag";
28
- }
29
- else if (weekday == 6) {
30
- weekdayAsString = "Samstag_heute1";
31
- }
32
- else if (weekday == 7) {
33
- weekdayAsString = "Sonntag";
34
- }
35
- else if (weekday == 0) {
36
- weekdayAsString = "Sonntag";
37
- }
38
- return weekdayAsString;
39
- };
40
- return DateHelper;
41
- }());
42
- exports.DateHelper = DateHelper;
43
- module.exports = { DateHelper: DateHelper };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DateHelper = void 0;
4
+ var DateHelper = /** @class */ (function () {
5
+ function DateHelper() {
6
+ }
7
+ DateHelper.prototype.getCurrentWeekdayAsString = function () {
8
+ var now = new Date();
9
+ var weekday = now.getDay();
10
+ return this.getWeekdayAsString(weekday);
11
+ };
12
+ DateHelper.prototype.getWeekdayAsString = function (weekday) {
13
+ var weekdayAsString;
14
+ if (weekday == 1) {
15
+ weekdayAsString = "Montag";
16
+ }
17
+ else if (weekday == 2) {
18
+ weekdayAsString = "Dienstag";
19
+ }
20
+ else if (weekday == 3) {
21
+ weekdayAsString = "Mittwoch";
22
+ }
23
+ else if (weekday == 4) {
24
+ weekdayAsString = "Donnerstag";
25
+ }
26
+ else if (weekday == 5) {
27
+ weekdayAsString = "Freitag";
28
+ }
29
+ else if (weekday == 6) {
30
+ weekdayAsString = "Samstag_heute1";
31
+ }
32
+ else if (weekday == 7) {
33
+ weekdayAsString = "Sonntag";
34
+ }
35
+ else if (weekday == 0) {
36
+ weekdayAsString = "Sonntag";
37
+ }
38
+ return weekdayAsString;
39
+ };
40
+ return DateHelper;
41
+ }());
42
+ exports.DateHelper = DateHelper;
43
+ module.exports = { DateHelper: DateHelper };