hoffmation-base 1.0.23 → 1.0.25-alpha.0

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.
@@ -0,0 +1,15 @@
1
+ import { DeviceSettings } from './deviceSettings';
2
+ export declare class WledSettings extends DeviceSettings {
3
+ dayOn: boolean;
4
+ dayBrightness: number;
5
+ dawnOn: boolean;
6
+ dawnBrightness: number;
7
+ duskOn: boolean;
8
+ duskBrightness: number;
9
+ nightOn: boolean;
10
+ nightBrightness: number;
11
+ dawnPreset?: number;
12
+ dayPreset?: number;
13
+ duskPreset?: number;
14
+ nightPreset?: number;
15
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WledSettings = void 0;
4
+ const deviceSettings_1 = require("./deviceSettings");
5
+ class WledSettings extends deviceSettings_1.DeviceSettings {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.dayOn = false;
9
+ this.dayBrightness = 100;
10
+ this.dawnOn = true;
11
+ this.dawnBrightness = 50;
12
+ this.duskOn = true;
13
+ this.duskBrightness = 50;
14
+ this.nightOn = true;
15
+ this.nightBrightness = 2;
16
+ }
17
+ }
18
+ exports.WledSettings = WledSettings;
@@ -1,15 +1,5 @@
1
- export declare class ButtonCapabilities {
2
- shortPress: boolean;
3
- doublePress: boolean;
4
- triplePress: boolean;
5
- longPress: boolean;
6
- }
7
- export declare enum ButtonPressType {
8
- short = 0,
9
- long = 1,
10
- double = 2,
11
- triple = 3
12
- }
1
+ import { ButtonCapabilities } from './buttonCapabilities';
2
+ import { ButtonPressType } from './buttonPressType';
13
3
  export declare class Button {
14
4
  name: string;
15
5
  buttonCapabilities: ButtonCapabilities;
@@ -21,4 +11,5 @@ export declare class Button {
21
11
  addCb(buttonType: ButtonPressType, pCallback: (pValue: boolean) => void, description?: string): void;
22
12
  getDescription(): string;
23
13
  updateState(type: ButtonPressType, pValue: boolean): void;
14
+ toJSON(): Partial<Button>;
24
15
  }
@@ -1,24 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Button = exports.ButtonPressType = exports.ButtonCapabilities = void 0;
4
- const services_1 = require("../services");
5
- const models_1 = require("../../models");
6
- class ButtonCapabilities {
7
- constructor() {
8
- this.shortPress = true;
9
- this.doublePress = true;
10
- this.triplePress = true;
11
- this.longPress = true;
12
- }
13
- }
14
- exports.ButtonCapabilities = ButtonCapabilities;
15
- var ButtonPressType;
16
- (function (ButtonPressType) {
17
- ButtonPressType[ButtonPressType["short"] = 0] = "short";
18
- ButtonPressType[ButtonPressType["long"] = 1] = "long";
19
- ButtonPressType[ButtonPressType["double"] = 2] = "double";
20
- ButtonPressType[ButtonPressType["triple"] = 3] = "triple";
21
- })(ButtonPressType = exports.ButtonPressType || (exports.ButtonPressType = {}));
3
+ exports.Button = void 0;
4
+ const services_1 = require("../../services");
5
+ const models_1 = require("../../../models");
6
+ const buttonPressType_1 = require("./buttonPressType");
22
7
  class Button {
23
8
  constructor(name, buttonCapabilities) {
24
9
  this.name = name;
@@ -27,24 +12,24 @@ class Button {
27
12
  this._callbacks = new Map();
28
13
  this._timeouts = new Map();
29
14
  if (buttonCapabilities.shortPress) {
30
- this._callbacks.set(ButtonPressType.short, []);
31
- this._timeouts.set(ButtonPressType.short, null);
32
- this._state.set(ButtonPressType.short, false);
15
+ this._callbacks.set(buttonPressType_1.ButtonPressType.short, []);
16
+ this._timeouts.set(buttonPressType_1.ButtonPressType.short, null);
17
+ this._state.set(buttonPressType_1.ButtonPressType.short, false);
33
18
  }
34
19
  if (buttonCapabilities.longPress) {
35
- this._callbacks.set(ButtonPressType.long, []);
36
- this._timeouts.set(ButtonPressType.long, null);
37
- this._state.set(ButtonPressType.long, false);
20
+ this._callbacks.set(buttonPressType_1.ButtonPressType.long, []);
21
+ this._timeouts.set(buttonPressType_1.ButtonPressType.long, null);
22
+ this._state.set(buttonPressType_1.ButtonPressType.long, false);
38
23
  }
39
24
  if (buttonCapabilities.doublePress) {
40
- this._callbacks.set(ButtonPressType.double, []);
41
- this._timeouts.set(ButtonPressType.double, null);
42
- this._state.set(ButtonPressType.double, false);
25
+ this._callbacks.set(buttonPressType_1.ButtonPressType.double, []);
26
+ this._timeouts.set(buttonPressType_1.ButtonPressType.double, null);
27
+ this._state.set(buttonPressType_1.ButtonPressType.double, false);
43
28
  }
44
29
  if (buttonCapabilities.triplePress) {
45
- this._callbacks.set(ButtonPressType.triple, []);
46
- this._timeouts.set(ButtonPressType.triple, null);
47
- this._state.set(ButtonPressType.triple, false);
30
+ this._callbacks.set(buttonPressType_1.ButtonPressType.triple, []);
31
+ this._timeouts.set(buttonPressType_1.ButtonPressType.triple, null);
32
+ this._state.set(buttonPressType_1.ButtonPressType.triple, false);
48
33
  }
49
34
  }
50
35
  getState(type) {
@@ -54,7 +39,7 @@ class Button {
54
39
  addCb(buttonType, pCallback, description = 'Not described') {
55
40
  const cbArr = this._callbacks.get(buttonType);
56
41
  if (cbArr === undefined) {
57
- services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `This Button doesn't support press Type ${ButtonPressType[buttonType]}`);
42
+ services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `This Button doesn't support press Type ${buttonPressType_1.ButtonPressType[buttonType]}`);
58
43
  return;
59
44
  }
60
45
  cbArr.push({ cb: pCallback, description: description });
@@ -63,7 +48,7 @@ class Button {
63
48
  const description = [];
64
49
  for (const [key, arr] of this._callbacks.entries()) {
65
50
  for (const entry of arr) {
66
- description.push(`${ButtonPressType[key]}: "${entry.description}"`);
51
+ description.push(`${buttonPressType_1.ButtonPressType[key]}: "${entry.description}"`);
67
52
  }
68
53
  }
69
54
  return description.join('\n');
@@ -75,7 +60,7 @@ class Button {
75
60
  }
76
61
  this._state.set(type, pValue);
77
62
  if (!this._callbacks.has(type)) {
78
- services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `This Button doesn't support press Type ${ButtonPressType[type]}`);
63
+ services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `This Button doesn't support press Type ${buttonPressType_1.ButtonPressType[type]}`);
79
64
  return;
80
65
  }
81
66
  for (const c of (_a = this._callbacks.get(type)) !== null && _a !== void 0 ? _a : []) {
@@ -92,5 +77,8 @@ class Button {
92
77
  this.updateState(type, false);
93
78
  }, 5000, this));
94
79
  }
80
+ toJSON() {
81
+ return services_1.Utils.jsonFilter(this);
82
+ }
95
83
  }
96
84
  exports.Button = Button;
@@ -0,0 +1,6 @@
1
+ export declare class ButtonCapabilities {
2
+ shortPress: boolean;
3
+ doublePress: boolean;
4
+ triplePress: boolean;
5
+ longPress: boolean;
6
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ButtonCapabilities = void 0;
4
+ class ButtonCapabilities {
5
+ constructor() {
6
+ this.shortPress = true;
7
+ this.doublePress = true;
8
+ this.triplePress = true;
9
+ this.longPress = true;
10
+ }
11
+ }
12
+ exports.ButtonCapabilities = ButtonCapabilities;
@@ -0,0 +1,6 @@
1
+ export declare enum ButtonPressType {
2
+ short = 0,
3
+ long = 1,
4
+ double = 2,
5
+ triple = 3
6
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ButtonPressType = void 0;
4
+ var ButtonPressType;
5
+ (function (ButtonPressType) {
6
+ ButtonPressType[ButtonPressType["short"] = 0] = "short";
7
+ ButtonPressType[ButtonPressType["long"] = 1] = "long";
8
+ ButtonPressType[ButtonPressType["double"] = 2] = "double";
9
+ ButtonPressType[ButtonPressType["triple"] = 3] = "triple";
10
+ })(ButtonPressType = exports.ButtonPressType || (exports.ButtonPressType = {}));
@@ -0,0 +1,3 @@
1
+ export * from './button';
2
+ export * from './buttonCapabilities';
3
+ export * from './buttonPressType';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./button"), exports);
18
+ __exportStar(require("./buttonCapabilities"), exports);
19
+ __exportStar(require("./buttonPressType"), exports);
@@ -17,5 +17,6 @@ export declare enum DeviceClusterType {
17
17
  MagnetContact = 15,
18
18
  TemperaturSensor = 16,
19
19
  HumiditySensor = 17,
20
- Ac = 18
20
+ Ac = 18,
21
+ WLED = 19
21
22
  }
@@ -22,4 +22,5 @@ var DeviceClusterType;
22
22
  DeviceClusterType[DeviceClusterType["TemperaturSensor"] = 16] = "TemperaturSensor";
23
23
  DeviceClusterType[DeviceClusterType["HumiditySensor"] = 17] = "HumiditySensor";
24
24
  DeviceClusterType[DeviceClusterType["Ac"] = 18] = "Ac";
25
+ DeviceClusterType[DeviceClusterType["WLED"] = 19] = "WLED";
25
26
  })(DeviceClusterType = exports.DeviceClusterType || (exports.DeviceClusterType = {}));
@@ -2,11 +2,13 @@ import { ZigbeeIkeaSteckdose, ZigbeeIlluLedRGBCCT } from '../zigbee';
2
2
  import { BaseGroup } from './base-group';
3
3
  import { iLamp } from '../baseDeviceInterfaces';
4
4
  import { TimeOfDay } from '../../../models';
5
+ import { WledDevice } from '../wledDevice';
5
6
  export declare class LampenGroup extends BaseGroup {
6
- constructor(roomName: string, lampenIds?: string[], steckerIds?: string[], ledIds?: string[]);
7
+ constructor(roomName: string, lampenIds?: string[], steckerIds?: string[], ledIds?: string[], wledIds?: string[]);
7
8
  anyLightsOn(): boolean;
8
9
  getLampen(): iLamp[];
9
10
  getLED(): ZigbeeIlluLedRGBCCT[];
11
+ getWled(): WledDevice[];
10
12
  getStecker(): ZigbeeIkeaSteckdose[];
11
13
  handleSunriseOff(): void;
12
14
  switchAll(target: boolean, force?: boolean): void;
@@ -8,11 +8,12 @@ const device_cluster_type_1 = require("../device-cluster-type");
8
8
  const device_list_1 = require("../device-list");
9
9
  const models_1 = require("../../../models");
10
10
  class LampenGroup extends base_group_1.BaseGroup {
11
- constructor(roomName, lampenIds = [], steckerIds = [], ledIds = []) {
11
+ constructor(roomName, lampenIds = [], steckerIds = [], ledIds = [], wledIds = []) {
12
12
  super(roomName, group_type_1.GroupType.Light);
13
13
  this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.Lamps, new device_list_1.DeviceList(lampenIds));
14
14
  this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.Outlets, new device_list_1.DeviceList(steckerIds));
15
15
  this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.LED, new device_list_1.DeviceList(ledIds));
16
+ this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.WLED, new device_list_1.DeviceList(wledIds));
16
17
  }
17
18
  anyLightsOn() {
18
19
  let i;
@@ -31,6 +32,11 @@ class LampenGroup extends base_group_1.BaseGroup {
31
32
  return true;
32
33
  }
33
34
  }
35
+ for (i = 0; i < this.getWled().length; i++) {
36
+ if (this.getWled()[i].on) {
37
+ return true;
38
+ }
39
+ }
34
40
  return false;
35
41
  }
36
42
  getLampen() {
@@ -39,6 +45,9 @@ class LampenGroup extends base_group_1.BaseGroup {
39
45
  getLED() {
40
46
  return this.deviceCluster.getIoBrokerDevicesByType(device_cluster_type_1.DeviceClusterType.LED);
41
47
  }
48
+ getWled() {
49
+ return this.deviceCluster.getIoBrokerDevicesByType(device_cluster_type_1.DeviceClusterType.WLED);
50
+ }
42
51
  getStecker() {
43
52
  return this.deviceCluster.getIoBrokerDevicesByType(device_cluster_type_1.DeviceClusterType.Outlets);
44
53
  }
@@ -55,6 +64,9 @@ class LampenGroup extends base_group_1.BaseGroup {
55
64
  this.getLED().forEach((s) => {
56
65
  s.setLight(target);
57
66
  });
67
+ this.getWled().forEach((wled) => {
68
+ wled.setLight(target);
69
+ });
58
70
  }
59
71
  switchTimeConditional(time) {
60
72
  const darkOutside = services_1.TimeCallbackService.darkOutsideOrNight(time);
@@ -65,6 +77,9 @@ class LampenGroup extends base_group_1.BaseGroup {
65
77
  this.getLED().forEach((s) => {
66
78
  s.setTimeBased(time);
67
79
  });
80
+ this.getWled().forEach((wled) => {
81
+ wled.setTimeBased(time);
82
+ });
68
83
  }
69
84
  else if (this.getStecker().length > 0) {
70
85
  this.log(models_1.LogLevel.Trace, `Set outlets time based for time "${models_1.TimeOfDay[time]}"`);
@@ -5,8 +5,8 @@ const base_group_1 = require("./base-group");
5
5
  const device_cluster_type_1 = require("../device-cluster-type");
6
6
  const group_type_1 = require("./group-type");
7
7
  const device_list_1 = require("../device-list");
8
- const button_1 = require("../button");
9
8
  const services_1 = require("../../services");
9
+ const button_1 = require("../button");
10
10
  class TasterGroup extends base_group_1.BaseGroup {
11
11
  constructor(roomName, buttonIds) {
12
12
  super(roomName, group_type_1.GroupType.Buttons);
@@ -1,10 +1,10 @@
1
1
  export * from './baseDeviceInterfaces/index';
2
+ export * from './button/index';
2
3
  export * from './groups/index';
3
4
  export * from './hmIPDevices/index';
4
5
  export * from './jsObject/index';
5
6
  export * from './models/index';
6
7
  export * from './zigbee/index';
7
- export * from './button';
8
8
  export * from './device-cluster';
9
9
  export * from './device-cluster-type';
10
10
  export * from './device-list';
@@ -15,12 +15,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./baseDeviceInterfaces/index"), exports);
18
+ __exportStar(require("./button/index"), exports);
18
19
  __exportStar(require("./groups/index"), exports);
19
20
  __exportStar(require("./hmIPDevices/index"), exports);
20
21
  __exportStar(require("./jsObject/index"), exports);
21
22
  __exportStar(require("./models/index"), exports);
22
23
  __exportStar(require("./zigbee/index"), exports);
23
- __exportStar(require("./button"), exports);
24
24
  __exportStar(require("./device-cluster"), exports);
25
25
  __exportStar(require("./device-cluster-type"), exports);
26
26
  __exportStar(require("./device-list"), exports);
@@ -1,16 +1,20 @@
1
1
  /// <reference types="iobroker" />
2
2
  import { IoBrokerBaseDevice } from './IoBrokerBaseDevice';
3
3
  import { DeviceInfo } from './DeviceInfo';
4
+ import { TimeOfDay } from '../../models';
5
+ import { WledSettings } from '../../models/deviceSettings/wledSettings';
4
6
  export declare class WledDevice extends IoBrokerBaseDevice {
5
7
  on: boolean;
6
8
  brightness: number;
7
9
  linkQuality: number;
8
10
  battery: number;
9
11
  voltage: string;
10
- private _onID;
11
- private _brightnessID;
12
+ settings: WledSettings;
13
+ private readonly _onID;
14
+ private readonly _presetID;
15
+ private readonly _brightnessID;
12
16
  constructor(pInfo: DeviceInfo);
13
17
  update(idSplit: string[], state: ioBroker.State, initial?: boolean, _pOverride?: boolean): void;
14
- setLight(pValue: boolean, brightness?: number): void;
15
- protected addToCorrectRoom(): void;
18
+ setLight(pValue: boolean, brightness?: number, preset?: number): void;
19
+ setTimeBased(time: TimeOfDay): void;
16
20
  }
@@ -5,6 +5,7 @@ const IoBrokerBaseDevice_1 = require("./IoBrokerBaseDevice");
5
5
  const deviceType_1 = require("./deviceType");
6
6
  const services_1 = require("../services");
7
7
  const models_1 = require("../../models");
8
+ const wledSettings_1 = require("../../models/deviceSettings/wledSettings");
8
9
  class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
9
10
  constructor(pInfo) {
10
11
  super(pInfo, deviceType_1.DeviceType.Wled);
@@ -13,8 +14,10 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
13
14
  this.linkQuality = 0;
14
15
  this.battery = -1;
15
16
  this.voltage = '';
17
+ this.settings = new wledSettings_1.WledSettings();
16
18
  this.addToCorrectRoom();
17
19
  this._onID = `${this.info.fullID}.on`;
20
+ this._presetID = `${this.info.fullID}.ps`;
18
21
  this._brightnessID = `${this.info.fullID}.bri`;
19
22
  }
20
23
  update(idSplit, state, initial = false, _pOverride = false) {
@@ -28,7 +31,7 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
28
31
  break;
29
32
  }
30
33
  }
31
- setLight(pValue, brightness = -1) {
34
+ setLight(pValue, brightness = -1, preset) {
32
35
  if (this._onID === '') {
33
36
  services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `Keine On ID für "${this.info.customName}" bekannt.`);
34
37
  return;
@@ -37,10 +40,15 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
37
40
  services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `Keine Connection für "${this.info.customName}" bekannt.`);
38
41
  return;
39
42
  }
40
- if (pValue && brightness === -1 && this.brightness < 10) {
43
+ if (pValue && brightness !== -1 && this.brightness < 10) {
41
44
  brightness = 10;
42
45
  }
43
46
  services_1.ServerLogService.writeLog(models_1.LogLevel.Debug, `WLED Schalten: "${this.info.customName}" An: ${pValue}\tHelligkeit: ${brightness}%`);
47
+ if (preset !== undefined) {
48
+ this.setState(this._presetID, preset, undefined, (err) => {
49
+ services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `WLED schalten ergab Fehler: ${err}`);
50
+ });
51
+ }
44
52
  this.setState(this._onID, pValue, undefined, (err) => {
45
53
  services_1.ServerLogService.writeLog(models_1.LogLevel.Error, `WLED schalten ergab Fehler: ${err}`);
46
54
  });
@@ -50,14 +58,28 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
50
58
  });
51
59
  }
52
60
  }
53
- addToCorrectRoom() {
54
- services_1.ServerLogService.writeLog(models_1.LogLevel.DeepTrace, `Neues Zigbee Gerät für ${this._info.room}`);
55
- switch (this._info.room) {
56
- case 'Wohnz':
57
- // room1OGWohn.addWLED(this._info);
61
+ setTimeBased(time) {
62
+ switch (time) {
63
+ case models_1.TimeOfDay.Night:
64
+ if (this.settings.nightOn) {
65
+ this.setLight(true, this.settings.nightBrightness, this.settings.nightPreset);
66
+ }
67
+ break;
68
+ case models_1.TimeOfDay.AfterSunset:
69
+ if (this.settings.duskOn) {
70
+ this.setLight(true, this.settings.duskBrightness, this.settings.duskPreset);
71
+ }
72
+ break;
73
+ case models_1.TimeOfDay.BeforeSunrise:
74
+ if (this.settings.dawnOn) {
75
+ this.setLight(true, this.settings.dawnBrightness, this.settings.dawnPreset);
76
+ }
77
+ break;
78
+ case models_1.TimeOfDay.Daylight:
79
+ if (this.settings.dayOn) {
80
+ this.setLight(true, this.settings.dayBrightness, this.settings.dayPreset);
81
+ }
58
82
  break;
59
- default:
60
- console.warn(`${this._info.room} ist noch kein bekannter Raum für WLED Geräte`);
61
83
  }
62
84
  }
63
85
  }
@@ -78,9 +78,8 @@ class TelegramService {
78
78
  this.sendMessage(this.subscribedIDs, message);
79
79
  }
80
80
  static sendMessage(ids, message) {
81
- if (!TelegramService.active) {
82
- // We can't use Log Service here, as it might result in a recursion
83
- console.log(`Telegram message ${message} wasn't send as TelegramService is inactive`);
81
+ if (!this.active) {
82
+ log_service_1.ServerLogService.writeLog(models_1.LogLevel.Debug, `Would have send telegram message, but telegram is not active`);
84
83
  return;
85
84
  }
86
85
  const chunksNeeded = Math.ceil(message.length / 4095);
@@ -16,7 +16,7 @@ class API {
16
16
  return ac_1.OwnAcDevices.ownDevices[name];
17
17
  }
18
18
  static getDevices() {
19
- // console.log(inspect(Devices.alLDevices, false, 3));
19
+ // console.log(Util.inspect(Devices.alLDevices, false, 5));
20
20
  return devices_1.Devices.alLDevices;
21
21
  }
22
22
  static getDevice(id) {
@@ -11,6 +11,7 @@ export declare class MuellService {
11
11
  static graueTonne: MuellTonne;
12
12
  static gelbeTonne: MuellTonne;
13
13
  static brauneTonne: MuellTonne;
14
+ static loadingPending: boolean;
14
15
  static updateTimeCallback: TimeCallback;
15
16
  static checkTimeCallback: TimeCallback;
16
17
  static months: string[];
@@ -27,6 +27,7 @@ class MuellService {
27
27
  node_ical_1.async
28
28
  .fromURL(this._calendarURL)
29
29
  .then((data) => {
30
+ this.loadingPending = false;
30
31
  this.gelbeTonne = new muell_tonne_1.MuellTonne('Gelbe Tonne', this.defaultSonosDevice);
31
32
  this.graueTonne = new muell_tonne_1.MuellTonne('Graue Tonne', this.defaultSonosDevice);
32
33
  this.blaueTonne = new muell_tonne_1.MuellTonne('Blaue Tonne', this.defaultSonosDevice);
@@ -73,6 +74,7 @@ class MuellService {
73
74
  }
74
75
  })
75
76
  .catch((r) => {
77
+ this.loadingPending = true;
76
78
  log_service_1.ServerLogService.writeLog(models_1.LogLevel.Error, `Loading Trash Calendar failed with error: "${r}"`);
77
79
  });
78
80
  }
@@ -106,6 +108,7 @@ class MuellService {
106
108
  }
107
109
  exports.MuellService = MuellService;
108
110
  MuellService.alleTonnen = [];
111
+ MuellService.loadingPending = true;
109
112
  MuellService.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
110
113
  MuellService.lastCheck = new Date(0);
111
114
  MuellService._active = false;