iobroker-ucl 1.0.27 → 1.0.29

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.
Files changed (3) hide show
  1. package/package.json +1 -1
  2. package/test.js +6 -3
  3. package/test.ts +7 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker-ucl",
3
- "version": "1.0.27",
3
+ "version": "1.0.29",
4
4
  "main": "main.js",
5
5
  "scripts": {
6
6
  "build": "tsc --build",
package/test.js CHANGED
@@ -7,7 +7,7 @@ var DateCalendarTest = /** @class */ (function () {
7
7
  }
8
8
  DateCalendarTest.prototype.getCurrentWeekdayAsString = function () {
9
9
  var mediolaText = "0_userdata.0.hue.mediola_status_text_hallo";
10
- console.log(">>> Create state: " + mediolaText);
10
+ this.adapter.log(">>> Create state: " + mediolaText);
11
11
  this.adapter.createState(mediolaText, "Hello World!", {
12
12
  name: mediolaText,
13
13
  desc: mediolaText,
@@ -15,8 +15,11 @@ var DateCalendarTest = /** @class */ (function () {
15
15
  read: true,
16
16
  write: true
17
17
  });
18
- this.adapter.setState(mediolaText, new Date().getTime());
19
- console.log("<<< State created!");
18
+ var now = new Date();
19
+ var lastUpdate = now.getDate().toString().padStart(2, '0') + "." + (now.getMonth() + 1).toString().padStart(2, '0') + "." + now.getFullYear();
20
+ lastUpdate = lastUpdate + ", " + now.getHours().toString().padStart(2, '0') + ":" + now.getMinutes().toString().padStart(2, '0') + ":" + now.getSeconds().toString().padStart(2, '0') + "";
21
+ this.adapter.setState(mediolaText, lastUpdate);
22
+ this.adapter.log("<<< State created!");
20
23
  var now = new Date();
21
24
  var weekday = now.getDay();
22
25
  return this.getWeekdayAsString(weekday);
package/test.ts CHANGED
@@ -7,7 +7,7 @@ export class DateCalendarTest {
7
7
 
8
8
  public getCurrentWeekdayAsString() : string {
9
9
  var mediolaText = "0_userdata.0.hue.mediola_status_text_hallo";
10
- console.log(">>> Create state: " + mediolaText);
10
+ this.adapter.log(">>> Create state: " + mediolaText);
11
11
  this.adapter.createState(mediolaText, "Hello World!", {
12
12
  name: mediolaText,
13
13
  desc: mediolaText,
@@ -15,8 +15,12 @@ export class DateCalendarTest {
15
15
  read: true,
16
16
  write: true
17
17
  });
18
- this.adapter.setState(mediolaText, new Date().getTime());
19
- console.log("<<< State created!");
18
+
19
+ var now = new Date();
20
+ var lastUpdate = now.getDate().toString().padStart(2,'0') + "." + (now.getMonth()+1).toString().padStart(2,'0') + "." + now.getFullYear();
21
+ lastUpdate = lastUpdate + ", " + now.getHours().toString().padStart(2,'0') + ":" + now.getMinutes().toString().padStart(2,'0') + ":" + now.getSeconds().toString().padStart(2,'0') + "";
22
+ this.adapter.setState(mediolaText, lastUpdate);
23
+ this.adapter.log("<<< State created!");
20
24
 
21
25
  var now = new Date();
22
26
  let weekday = now.getDay();