iobroker-ucl 1.4.9 → 1.4.11
Sign up to get free protection for your applications and to get access to all the features.
- package/!!!_INSTRUCTIONS_!!!.ts +38 -3
- package/alexa.js +103 -103
- package/camera.js +60 -61
- package/camera.ts +5 -5
- package/date.js +43 -43
- package/homematicClasses.js +775 -775
- package/homematicFunctions.js +953 -954
- package/html.js +417 -417
- package/main.js +185 -185
- package/package.json +1 -1
- package/shellyClasses.js +763 -763
- package/shellyFunctions.js +732 -733
- package/test.js +59 -58
- package/test.ts +2 -0
- package/zigbeeClasses.js +1139 -1139
- package/zigbeeFunctions.js +1189 -1190
package/!!!_INSTRUCTIONS_!!!.ts
CHANGED
@@ -22,7 +22,42 @@ npm update iobroker-ucl (initial installieren mit: npm install
|
|
22
22
|
// 6.) In iobroker Weboberfläche die Javascript Instance restarten
|
23
23
|
|
24
24
|
|
25
|
-
// TODO: Auto TS:
|
26
|
-
https://www.youtube.com/watch?v=PDhQQCI4PJE
|
27
25
|
|
28
|
-
|
26
|
+
|
27
|
+
Neuer Rechner alles wieder einrichten:
|
28
|
+
|
29
|
+
Basierend auf:
|
30
|
+
https://www.youtube.com/watch?v=NqANV4wXhx4
|
31
|
+
|
32
|
+
1.) Node.js installieren auf Windows (Checkbox bei Installation "Chocolatey" aktivieren)
|
33
|
+
https://nodejs.org/en/download/
|
34
|
+
|
35
|
+
2.) IDE Visual Studio Code installieren
|
36
|
+
https://code.visualstudio.com/download
|
37
|
+
|
38
|
+
3.) Download Git für Windows:
|
39
|
+
https://git-scm.com/downloads/win
|
40
|
+
|
41
|
+
Auf Github gehen:
|
42
|
+
uwe72@gmx.de
|
43
|
+
|
44
|
+
URL vom Projekt kopieren:
|
45
|
+
https://github.com/uwe72/iobroker-ucl.git
|
46
|
+
|
47
|
+
Mit DOS-Konsole gehen auf c:/Projects
|
48
|
+
Dann Befehl
|
49
|
+
git clone https://github.com/uwe72/iobroker-ucl.git
|
50
|
+
|
51
|
+
Dann Visual Studio Code rein und links auf "Open Folder klicker"
|
52
|
+
|
53
|
+
Iin Git Bash:
|
54
|
+
$ git config --global user.name "John Doe"
|
55
|
+
$ git config --global user.email johndoe@example.com
|
56
|
+
|
57
|
+
npm adduser
|
58
|
+
|
59
|
+
User is: uwe72.iobroker
|
60
|
+
https://www.npmjs.com/settings/uwe72.iobroker/packages
|
61
|
+
|
62
|
+
|
63
|
+
npm install -g typescript
|
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.
|
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
|
-
function sendToPictureGarageToTelegram(adapter, caption) {
|
51
|
-
axios.get("
|
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
|
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("https://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("https://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("https://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("https://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("https://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/camera.ts
CHANGED
@@ -2,7 +2,7 @@ var fs = require('fs');
|
|
2
2
|
const axios = require('axios');
|
3
3
|
|
4
4
|
export function sendToPictureGartenToTelegram(adapter:any, caption:string) {
|
5
|
-
axios.get("
|
5
|
+
axios.get("https://192.168.178.188/snap.jpeg", { responseType: 'arraybuffer'}).then(function (response) {
|
6
6
|
let filename = "/opt/iobroker/telegramm.jpeg";
|
7
7
|
fs.writeFile(filename, response.data, 'binary', function(err) { // Hier wird der erzeugte Namen (picdate) mit dem Pfad zum Speichern übergeben!
|
8
8
|
if (err == null) {
|
@@ -13,7 +13,7 @@ export function sendToPictureGartenToTelegram(adapter:any, caption:string) {
|
|
13
13
|
}
|
14
14
|
|
15
15
|
export function sendToPictureSeiteToTelegram(adapter:any, caption:string) {
|
16
|
-
axios.get("
|
16
|
+
axios.get("https://192.168.178.38/snap.jpeg", { responseType: 'arraybuffer'}).then(function (response) {
|
17
17
|
let filename = "/opt/iobroker/telegramm.jpeg";
|
18
18
|
fs.writeFile(filename, response.data, 'binary', function(err) { // Hier wird der erzeugte Namen (picdate) mit dem Pfad zum Speichern übergeben!
|
19
19
|
if (err == null) {
|
@@ -24,7 +24,7 @@ export function sendToPictureSeiteToTelegram(adapter:any, caption:string) {
|
|
24
24
|
}
|
25
25
|
|
26
26
|
export function sendToPictureHaustuereToTelegram(adapter:any, caption:string) {
|
27
|
-
axios.get("
|
27
|
+
axios.get("https://192.168.178.173/snap.jpeg", { responseType: 'arraybuffer'}).then(function (response) {
|
28
28
|
let filename = "/opt/iobroker/telegramm.jpeg";
|
29
29
|
fs.writeFile(filename, response.data, 'binary', function(err) { // Hier wird der erzeugte Namen (picdate) mit dem Pfad zum Speichern übergeben!
|
30
30
|
if (err == null) {
|
@@ -35,7 +35,7 @@ export function sendToPictureHaustuereToTelegram(adapter:any, caption:string) {
|
|
35
35
|
}
|
36
36
|
|
37
37
|
export function sendToPictureDoorbellToTelegram(adapter:any, caption:string) {
|
38
|
-
axios.get("
|
38
|
+
axios.get("https://192.168.178.90/snap.jpeg", { responseType: 'arraybuffer'}).then(function (response) {
|
39
39
|
let filename = "/opt/iobroker/telegramm.jpeg";
|
40
40
|
fs.writeFile(filename, response.data, 'binary', function(err) { // Hier wird der erzeugte Namen (picdate) mit dem Pfad zum Speichern übergeben!
|
41
41
|
if (err == null) {
|
@@ -46,7 +46,7 @@ export function sendToPictureDoorbellToTelegram(adapter:any, caption:string) {
|
|
46
46
|
}
|
47
47
|
|
48
48
|
export function sendToPictureGarageToTelegram(adapter:any, caption:string) {
|
49
|
-
axios.get("
|
49
|
+
axios.get("https://192.168.178.166/snap.jpeg", { responseType: 'arraybuffer'}).then(function (response) {
|
50
50
|
let filename = "/opt/iobroker/telegramm.jpeg";
|
51
51
|
fs.writeFile(filename, response.data, 'binary', function(err) { // Hier wird der erzeugte Namen (picdate) mit dem Pfad zum Speichern übergeben!
|
52
52
|
if (err == null) {
|
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 };
|