hoffmation-base 0.1.41-20 → 0.1.41-22

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 (130) hide show
  1. package/lib/index.js +1 -1
  2. package/lib/models/deviceSettings/heaterSettings.d.ts +16 -0
  3. package/lib/models/deviceSettings/heaterSettings.js +16 -0
  4. package/lib/models/rooms/RoomBase.js +2 -1
  5. package/lib/models/rooms/RoomSettings/RoomInitializationSettings.d.ts +1 -1
  6. package/lib/models/rooms/RoomSettings/RoomInitializationSettings.js +2 -2
  7. package/lib/models/rooms/RoomSettings/roomAddDeviceItem.d.ts +1 -1
  8. package/lib/models/rooms/RoomSettings/roomAddDeviceItem.js +2 -2
  9. package/lib/models/rooms/RoomSettings/roomDeviceAddingSettings.d.ts +1 -1
  10. package/lib/models/rooms/RoomSettings/roomDeviceAddingSettings.js +3 -4
  11. package/lib/models/rooms/roomInfo.d.ts +1 -1
  12. package/lib/server/config/iConfig.d.ts +1 -2
  13. package/lib/server/devices/DeviceInfo.d.ts +3 -3
  14. package/lib/server/devices/DeviceInfo.js +3 -3
  15. package/lib/server/devices/Griffe.d.ts +1 -1
  16. package/lib/server/devices/Griffe.js +2 -2
  17. package/lib/server/devices/IoBrokerBaseDevice.d.ts +1 -1
  18. package/lib/server/devices/{iBaseDevice.d.ts → baseDeviceInterfaces/iBaseDevice.d.ts} +3 -3
  19. package/lib/server/devices/{iBaseDevice.js → baseDeviceInterfaces/iBaseDevice.js} +0 -0
  20. package/lib/server/devices/{iButtonSwitch.d.ts → baseDeviceInterfaces/iButtonSwitch.d.ts} +1 -1
  21. package/lib/server/devices/{iButtonSwitch.js → baseDeviceInterfaces/iButtonSwitch.js} +0 -0
  22. package/lib/server/devices/{iEnergyManager.d.ts → baseDeviceInterfaces/iEnergyManager.d.ts} +0 -0
  23. package/lib/server/devices/{iEnergyManager.js → baseDeviceInterfaces/iEnergyManager.js} +0 -0
  24. package/lib/server/devices/{iExcessEnergyConsumer.d.ts → baseDeviceInterfaces/iExcessEnergyConsumer.d.ts} +1 -1
  25. package/lib/server/devices/{iExcessEnergyConsumer.js → baseDeviceInterfaces/iExcessEnergyConsumer.js} +0 -0
  26. package/lib/server/devices/{iHeater.d.ts → baseDeviceInterfaces/iHeater.d.ts} +4 -1
  27. package/lib/server/devices/{iHeater.js → baseDeviceInterfaces/iHeater.js} +0 -0
  28. package/lib/server/devices/{iHumiditySensor.d.ts → baseDeviceInterfaces/iHumiditySensor.d.ts} +0 -0
  29. package/lib/server/devices/{iHumiditySensor.js → baseDeviceInterfaces/iHumiditySensor.js} +0 -0
  30. package/lib/server/devices/{iIlluminationSensor.d.ts → baseDeviceInterfaces/iIlluminationSensor.d.ts} +0 -0
  31. package/lib/server/devices/{iIlluminationSensor.js → baseDeviceInterfaces/iIlluminationSensor.js} +0 -0
  32. package/lib/server/devices/{iLamp.d.ts → baseDeviceInterfaces/iLamp.d.ts} +1 -1
  33. package/lib/server/devices/{iLamp.js → baseDeviceInterfaces/iLamp.js} +0 -0
  34. package/lib/server/devices/{iMotionSensor.d.ts → baseDeviceInterfaces/iMotionSensor.d.ts} +1 -1
  35. package/lib/server/devices/{iMotionSensor.js → baseDeviceInterfaces/iMotionSensor.js} +0 -0
  36. package/lib/server/devices/{iShutter.d.ts → baseDeviceInterfaces/iShutter.d.ts} +1 -1
  37. package/lib/server/devices/{iShutter.js → baseDeviceInterfaces/iShutter.js} +0 -0
  38. package/lib/server/devices/{iTemperaturSensor.d.ts → baseDeviceInterfaces/iTemperaturSensor.d.ts} +2 -0
  39. package/lib/server/devices/{iTemperaturSensor.js → baseDeviceInterfaces/iTemperaturSensor.js} +2 -0
  40. package/lib/server/devices/{iVibrationSensor.d.ts → baseDeviceInterfaces/iVibrationSensor.d.ts} +0 -0
  41. package/lib/server/devices/{iVibrationSensor.js → baseDeviceInterfaces/iVibrationSensor.js} +0 -0
  42. package/lib/server/devices/baseDeviceInterfaces/index.d.ts +12 -0
  43. package/lib/server/devices/baseDeviceInterfaces/index.js +28 -0
  44. package/lib/server/devices/device-cluster.d.ts +1 -1
  45. package/lib/server/devices/device-list.d.ts +1 -1
  46. package/lib/server/devices/deviceType.d.ts +1 -0
  47. package/lib/server/devices/deviceType.js +1 -0
  48. package/lib/server/devices/devices.d.ts +1 -2
  49. package/lib/server/devices/devices.js +4 -0
  50. package/lib/server/devices/groups/Fenster.d.ts +1 -2
  51. package/lib/server/devices/groups/base-group.d.ts +2 -3
  52. package/lib/server/devices/groups/base-group.js +3 -5
  53. package/lib/server/devices/groups/heatGroup.d.ts +4 -4
  54. package/lib/server/devices/groups/heatGroup.js +46 -1
  55. package/lib/server/devices/groups/lampenGroup.d.ts +1 -1
  56. package/lib/server/devices/groups/praesenzGroup.d.ts +1 -1
  57. package/lib/server/devices/groups/smokeGroup.d.ts +2 -2
  58. package/lib/server/devices/groups/smokeGroup.js +3 -3
  59. package/lib/server/devices/groups/sonosGroup.d.ts +1 -1
  60. package/lib/server/devices/groups/sonosGroup.js +2 -2
  61. package/lib/server/devices/groups/tasterGroup.d.ts +1 -1
  62. package/lib/server/devices/groups/waterGroup.d.ts +2 -2
  63. package/lib/server/devices/groups/waterGroup.js +3 -3
  64. package/lib/server/devices/hmIPDevices/hmIpAccessPoint.d.ts +1 -1
  65. package/lib/server/devices/hmIPDevices/hmIpAccessPoint.js +2 -2
  66. package/lib/server/devices/hmIPDevices/hmIpBewegung.d.ts +1 -2
  67. package/lib/server/devices/hmIPDevices/hmIpDevice.js +5 -5
  68. package/lib/server/devices/hmIPDevices/hmIpGriff.d.ts +3 -3
  69. package/lib/server/devices/hmIPDevices/hmIpGriff.js +21 -23
  70. package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.d.ts +14 -4
  71. package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.js +60 -6
  72. package/lib/server/devices/hmIPDevices/hmIpHeizung.d.ts +1 -1
  73. package/lib/server/devices/hmIPDevices/hmIpHeizung.js +4 -4
  74. package/lib/server/devices/hmIPDevices/hmIpLampe.d.ts +1 -1
  75. package/lib/server/devices/hmIPDevices/hmIpPraezenz.d.ts +1 -1
  76. package/lib/server/devices/hmIPDevices/hmIpRoll.d.ts +9 -9
  77. package/lib/server/devices/hmIPDevices/hmIpRoll.js +21 -21
  78. package/lib/server/devices/hmIPDevices/hmIpTaster.d.ts +1 -1
  79. package/lib/server/devices/hmIPDevices/hmIpTaster.js +2 -2
  80. package/lib/server/devices/hmIPDevices/hmIpTherm.js +2 -2
  81. package/lib/server/devices/hmIPDevices/hmIpTuer.d.ts +1 -1
  82. package/lib/server/devices/hmIPDevices/hmIpTuer.js +18 -21
  83. package/lib/server/devices/hmIPDevices/hmIpWippe.d.ts +1 -1
  84. package/lib/server/devices/hmIPDevices/hmIpWippe.js +4 -4
  85. package/lib/server/devices/index.d.ts +1 -12
  86. package/lib/server/devices/index.js +1 -12
  87. package/lib/server/devices/jsObject/jsObjectEnergyManager.d.ts +1 -2
  88. package/lib/server/devices/jsObject/jsObjectEnergyManager.js +7 -7
  89. package/lib/server/devices/wledDevice.js +9 -9
  90. package/lib/server/devices/zigbee/BaseDevices/zigbeeHeater.d.ts +9 -1
  91. package/lib/server/devices/zigbee/BaseDevices/zigbeeHeater.js +40 -4
  92. package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.d.ts +1 -1
  93. package/lib/server/devices/zigbee/BaseDevices/zigbeeSwitch.d.ts +1 -1
  94. package/lib/server/devices/zigbee/zigbeeAquaraMotion.d.ts +1 -1
  95. package/lib/server/devices/zigbee/zigbeeAquaraVibra.d.ts +1 -1
  96. package/lib/server/devices/zigbee/zigbeeBlitzShp.d.ts +1 -1
  97. package/lib/server/devices/zigbee/zigbeeIlluDimmer.d.ts +1 -1
  98. package/lib/server/devices/zigbee/zigbeeIlluLampe.d.ts +1 -1
  99. package/lib/server/devices/zigbee/zigbeeMotionSensor.d.ts +1 -1
  100. package/lib/server/devices/zigbee/zigbeeSonoffMotion.js +2 -2
  101. package/lib/server/devices/zigbee/zigbeeSonoffTemp.d.ts +5 -3
  102. package/lib/server/devices/zigbee/zigbeeSonoffTemp.js +16 -2
  103. package/lib/server/devices/zigbee/zigbeeTuyaValve.d.ts +17 -2
  104. package/lib/server/devices/zigbee/zigbeeTuyaValve.js +98 -2
  105. package/lib/server/ioBroker/ioBroker.main.d.ts +3 -3
  106. package/lib/server/ioBroker/ioBroker.main.js +12 -16
  107. package/lib/server/services/HTTPSOptions.js +3 -3
  108. package/lib/server/services/Sonos/OwnSonosDevices.js +3 -3
  109. package/lib/server/services/Sonos/mp3-server.d.ts +1 -1
  110. package/lib/server/services/Sonos/mp3-server.js +4 -4
  111. package/lib/server/services/Sonos/polly-service.d.ts +2 -2
  112. package/lib/server/services/Sonos/polly-service.js +10 -10
  113. package/lib/server/services/Sonos/sonos-service.d.ts +4 -4
  114. package/lib/server/services/Sonos/sonos-service.js +22 -23
  115. package/lib/server/services/Translation/res.d.ts +1 -1
  116. package/lib/server/services/calendar/muell-tonne.d.ts +1 -1
  117. package/lib/server/services/calendar/muell-tonne.js +14 -14
  118. package/lib/server/services/https-service.d.ts +1 -1
  119. package/lib/server/services/https-service.js +11 -11
  120. package/lib/server/services/log-service/log-object.d.ts +1 -1
  121. package/lib/server/services/log-service/log-service.d.ts +4 -4
  122. package/lib/server/services/log-service/log-service.js +11 -11
  123. package/lib/server/services/news-service.d.ts +9 -9
  124. package/lib/server/services/news-service.js +40 -41
  125. package/lib/server/services/settings-service.d.ts +2 -2
  126. package/lib/server/services/settings-service.js +3 -3
  127. package/lib/server/services/utils/utils.d.ts +2 -0
  128. package/lib/server/services/utils/utils.js +9 -1
  129. package/lib/tsconfig.tsbuildinfo +1 -1
  130. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  import { ZigbeeIkeaSteckdose, ZigbeeIlluLedRGBCCT } from '../zigbee';
2
2
  import { BaseGroup } from './base-group';
3
- import { iLamp } from '../iLamp';
3
+ import { iLamp } from '../baseDeviceInterfaces';
4
4
  import { TimeOfDay } from '../../../models';
5
5
  export declare class LampenGroup extends BaseGroup {
6
6
  constructor(roomName: string, lampenIds?: string[], steckerIds?: string[], ledIds?: string[]);
@@ -1,6 +1,6 @@
1
1
  import { HmIpPraezenz } from '../hmIPDevices';
2
2
  import { BaseGroup } from './base-group';
3
- import { iMotionSensor } from '../iMotionSensor';
3
+ import { iMotionSensor } from '../baseDeviceInterfaces';
4
4
  export declare class PraesenzGroup extends BaseGroup {
5
5
  private _lastMovement;
6
6
  private _lastLeftTimeout;
@@ -1,7 +1,7 @@
1
- import { ZigbeeHeimanSmoke } from '../zigbee/zigbeeHeimanSmoke';
1
+ import { ZigbeeHeimanSmoke } from '../zigbee';
2
2
  import { BaseGroup } from './base-group';
3
3
  export declare class SmokeGroup extends BaseGroup {
4
- getSmokeDetectors(): ZigbeeHeimanSmoke[];
5
4
  constructor(roomName: string, smokeDetectorIds: string[]);
5
+ getSmokeDetectors(): ZigbeeHeimanSmoke[];
6
6
  stopAlarm(): void;
7
7
  }
@@ -6,13 +6,13 @@ 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
8
  class SmokeGroup extends base_group_1.BaseGroup {
9
- getSmokeDetectors() {
10
- return this.deviceCluster.getIoBrokerDevicesByType(device_cluster_type_1.DeviceClusterType.SmokeDetector);
11
- }
12
9
  constructor(roomName, smokeDetectorIds) {
13
10
  super(roomName, group_type_1.GroupType.Smoke);
14
11
  this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.SmokeDetector, new device_list_1.DeviceList(smokeDetectorIds));
15
12
  }
13
+ getSmokeDetectors() {
14
+ return this.deviceCluster.getIoBrokerDevicesByType(device_cluster_type_1.DeviceClusterType.SmokeDetector);
15
+ }
16
16
  stopAlarm() {
17
17
  for (const d of this.getSmokeDetectors()) {
18
18
  d.stopAlarm(true);
@@ -1,4 +1,4 @@
1
- import { OwnSonosDevice } from '../../services/Sonos/sonos-service';
1
+ import { OwnSonosDevice } from '../../services';
2
2
  import { BaseGroup } from './base-group';
3
3
  export declare class SonosGroup extends BaseGroup {
4
4
  private _playing;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SonosGroup = void 0;
4
- const utils_1 = require("../../services/utils/utils");
4
+ const services_1 = require("../../services");
5
5
  const base_group_1 = require("./base-group");
6
6
  const device_cluster_type_1 = require("../device-cluster-type");
7
7
  const group_type_1 = require("./group-type");
@@ -17,7 +17,7 @@ class SonosGroup extends base_group_1.BaseGroup {
17
17
  }
18
18
  playRadio(radioUrl) {
19
19
  this.getOwnSonosDevices().forEach((s) => {
20
- utils_1.Utils.guardedTimeout(() => {
20
+ services_1.Utils.guardedTimeout(() => {
21
21
  var _a;
22
22
  (_a = s.device) === null || _a === void 0 ? void 0 : _a.SetAVTransportURI(radioUrl);
23
23
  }, 1500);
@@ -1,5 +1,5 @@
1
1
  import { BaseGroup } from './base-group';
2
- import { iButtonSwitch } from '../iButtonSwitch';
2
+ import { iButtonSwitch } from '../baseDeviceInterfaces';
3
3
  export declare class TasterGroup extends BaseGroup {
4
4
  constructor(roomName: string, buttonIds: string[]);
5
5
  getButtons(): iButtonSwitch[];
@@ -1,7 +1,7 @@
1
- import { ZigbeeAquaraWater } from '../zigbee/zigbeeAquaraWater';
1
+ import { ZigbeeAquaraWater } from '../zigbee';
2
2
  import { BaseGroup } from './base-group';
3
3
  export declare class WaterGroup extends BaseGroup {
4
- getWaterDetectors(): ZigbeeAquaraWater[];
5
4
  constructor(roomName: string, waterDetectorIds: string[]);
5
+ getWaterDetectors(): ZigbeeAquaraWater[];
6
6
  stopAlarm(): void;
7
7
  }
@@ -6,13 +6,13 @@ 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
8
  class WaterGroup extends base_group_1.BaseGroup {
9
- getWaterDetectors() {
10
- return this.deviceCluster.getIoBrokerDevicesByType(device_cluster_type_1.DeviceClusterType.WaterDetectors);
11
- }
12
9
  constructor(roomName, waterDetectorIds) {
13
10
  super(roomName, group_type_1.GroupType.Water);
14
11
  this.deviceCluster.deviceMap.set(device_cluster_type_1.DeviceClusterType.WaterDetectors, new device_list_1.DeviceList(waterDetectorIds));
15
12
  }
13
+ getWaterDetectors() {
14
+ return this.deviceCluster.getIoBrokerDevicesByType(device_cluster_type_1.DeviceClusterType.WaterDetectors);
15
+ }
16
16
  stopAlarm() {
17
17
  for (const d of this.getWaterDetectors()) {
18
18
  d.stopAlarm(true);
@@ -2,9 +2,9 @@
2
2
  import { HmIPDevice } from './hmIpDevice';
3
3
  import { DeviceInfo } from '../DeviceInfo';
4
4
  export declare class HmIpAccessPoint extends HmIPDevice {
5
+ constructor(pInfo: DeviceInfo);
5
6
  private _ip;
6
7
  get ip(): string;
7
- constructor(pInfo: DeviceInfo);
8
8
  update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
9
9
  private updateBaseInformation;
10
10
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HmIpAccessPoint = void 0;
4
4
  const hmIpDevice_1 = require("./hmIpDevice");
5
5
  const deviceType_1 = require("../deviceType");
6
- const logLevel_1 = require("../../../models/logLevel");
6
+ const models_1 = require("../../../models");
7
7
  class HmIpAccessPoint extends hmIpDevice_1.HmIPDevice {
8
8
  constructor(pInfo) {
9
9
  super(pInfo, deviceType_1.DeviceType.HmIpAccessPoint);
@@ -13,7 +13,7 @@ class HmIpAccessPoint extends hmIpDevice_1.HmIPDevice {
13
13
  return this._ip;
14
14
  }
15
15
  update(idSplit, state, initial = false) {
16
- this.log(logLevel_1.LogLevel.DeepTrace, `AP Update: ID: ${idSplit.join('.')} JSON: ${JSON.stringify(state)}`);
16
+ this.log(models_1.LogLevel.DeepTrace, `AP Update: ID: ${idSplit.join('.')} JSON: ${JSON.stringify(state)}`);
17
17
  super.update(idSplit, state, initial, true);
18
18
  switch (idSplit[3]) {
19
19
  case '0':
@@ -2,8 +2,7 @@
2
2
  import { HmIPDevice } from './hmIpDevice';
3
3
  import { MotionSensorSettings } from '../../../models';
4
4
  import { DeviceInfo } from '../DeviceInfo';
5
- import { iIlluminationSensor } from '../iIlluminationSensor';
6
- import { iMotionSensor } from '../iMotionSensor';
5
+ import { iIlluminationSensor, iMotionSensor } from '../baseDeviceInterfaces';
7
6
  export declare class HmIpBewegung extends HmIPDevice implements iIlluminationSensor, iMotionSensor {
8
7
  private static MOVEMENT_DETECTION;
9
8
  private static CURRENT_ILLUMINATION;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HmIPDevice = void 0;
4
- const logLevel_1 = require("../../../models/logLevel");
4
+ const models_1 = require("../../../models");
5
5
  const IoBrokerBaseDevice_1 = require("../IoBrokerBaseDevice");
6
6
  class HmIPDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
7
7
  constructor(pInfo, pType) {
@@ -10,10 +10,10 @@ class HmIPDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
10
10
  }
11
11
  update(idSplit, state, initial = false, pOverride = false) {
12
12
  if (!pOverride) {
13
- this.log(logLevel_1.LogLevel.Trace, `Keine Update Überschreibung :\n\tID: ${idSplit.join('.')}`);
14
- this.log(logLevel_1.LogLevel.DeepTrace, `Data: ${JSON.stringify(state)}`);
13
+ this.log(models_1.LogLevel.Trace, `Keine Update Überschreibung :\n\tID: ${idSplit.join('.')}`);
14
+ this.log(models_1.LogLevel.DeepTrace, `Data: ${JSON.stringify(state)}`);
15
15
  }
16
- this.log(logLevel_1.LogLevel.DeepTrace, `Base-Device Update for ${this.info.customName}("${idSplit.join('.')}", ${state}, ${initial}, ${pOverride})`);
16
+ this.log(models_1.LogLevel.DeepTrace, `Base-Device Update for ${this.info.customName}("${idSplit.join('.')}", ${state}, ${initial}, ${pOverride})`);
17
17
  if (idSplit[3] !== '0') {
18
18
  // Dies ist etwas Gerätespezifisches
19
19
  return;
@@ -25,7 +25,7 @@ class HmIPDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
25
25
  case 'LOW_BAT':
26
26
  const newBatLowVal = state.val;
27
27
  if (newBatLowVal) {
28
- this.log(logLevel_1.LogLevel.Alert, `!!BATTERIE FAST LEER!!`);
28
+ this.log(models_1.LogLevel.Alert, `!!BATTERIE FAST LEER!!`);
29
29
  }
30
30
  break;
31
31
  }
@@ -1,8 +1,8 @@
1
1
  /// <reference types="iobroker" />
2
2
  import { HmIPDevice } from './hmIpDevice';
3
3
  import { DeviceInfo } from '../DeviceInfo';
4
- import { FensterPosition } from '../models/FensterPosition';
5
- import { Fenster } from '../groups/Fenster';
4
+ import { FensterPosition } from '../models';
5
+ import { Fenster } from '../groups';
6
6
  import { IoBrokerBaseDevice } from '../IoBrokerBaseDevice';
7
7
  export declare class HmIpGriff extends HmIPDevice {
8
8
  position: FensterPosition;
@@ -14,10 +14,10 @@ export declare class HmIpGriff extends HmIPDevice {
14
14
  private _fenster;
15
15
  private _helpingRoomTemp;
16
16
  constructor(pInfo: DeviceInfo);
17
+ set Fenster(value: Fenster);
17
18
  addOffenCallback(pCallback: (pValue: boolean) => void): void;
18
19
  addKippCallback(pCallback: (pValue: boolean) => void): void;
19
20
  addClosedCallback(pCallback: (pValue: boolean) => void): void;
20
- set Fenster(value: Fenster);
21
21
  update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
22
22
  updatePosition(pValue: FensterPosition): void;
23
23
  toJSON(): Partial<IoBrokerBaseDevice>;
@@ -6,16 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.HmIpGriff = void 0;
7
7
  const hmIpDevice_1 = require("./hmIpDevice");
8
8
  const deviceType_1 = require("../deviceType");
9
- const utils_1 = require("../../services/utils/utils");
10
- const weather_service_1 = require("../../services/weather/weather-service");
11
- const telegram_service_1 = require("../../services/Telegram/telegram-service");
12
- const FensterPosition_1 = require("../models/FensterPosition");
13
- const logLevel_1 = require("../../../models/logLevel");
9
+ const services_1 = require("../../services");
10
+ const models_1 = require("../models");
11
+ const models_2 = require("../../../models");
14
12
  const lodash_1 = __importDefault(require("lodash"));
15
13
  class HmIpGriff extends hmIpDevice_1.HmIPDevice {
16
14
  constructor(pInfo) {
17
15
  super(pInfo, deviceType_1.DeviceType.HmIpGriff);
18
- this.position = FensterPosition_1.FensterPosition.geschlossen;
16
+ this.position = models_1.FensterPosition.geschlossen;
19
17
  this._kippCallback = [];
20
18
  this._closedCallback = [];
21
19
  this._offenCallback = [];
@@ -23,6 +21,9 @@ class HmIpGriff extends hmIpDevice_1.HmIPDevice {
23
21
  this._fenster = undefined;
24
22
  this._helpingRoomTemp = false;
25
23
  }
24
+ set Fenster(value) {
25
+ this._fenster = value;
26
+ }
26
27
  addOffenCallback(pCallback) {
27
28
  this._offenCallback.push(pCallback);
28
29
  }
@@ -32,11 +33,8 @@ class HmIpGriff extends hmIpDevice_1.HmIPDevice {
32
33
  addClosedCallback(pCallback) {
33
34
  this._closedCallback.push(pCallback);
34
35
  }
35
- set Fenster(value) {
36
- this._fenster = value;
37
- }
38
36
  update(idSplit, state, initial = false) {
39
- this.log(logLevel_1.LogLevel.DeepTrace, `Griff Update: JSON: ${JSON.stringify(state)}ID: ${idSplit.join('.')}`);
37
+ this.log(models_2.LogLevel.DeepTrace, `Griff Update: JSON: ${JSON.stringify(state)}ID: ${idSplit.join('.')}`);
40
38
  super.update(idSplit, state, initial, true);
41
39
  switch (idSplit[3]) {
42
40
  case '1':
@@ -50,7 +48,7 @@ class HmIpGriff extends hmIpDevice_1.HmIPDevice {
50
48
  if (pValue === this.position) {
51
49
  return;
52
50
  }
53
- this.log(logLevel_1.LogLevel.Trace, `Update Fenstergriff auf Position "${FensterPosition_1.FensterPosition[pValue]}"`);
51
+ this.log(models_2.LogLevel.Trace, `Update Fenstergriff auf Position "${models_1.FensterPosition[pValue]}"`);
54
52
  this.position = pValue;
55
53
  for (const c1 of this._closedCallback) {
56
54
  c1(pValue === 0);
@@ -61,39 +59,39 @@ class HmIpGriff extends hmIpDevice_1.HmIPDevice {
61
59
  for (const c3 of this._offenCallback) {
62
60
  c3(pValue === 2);
63
61
  }
64
- if (pValue === FensterPosition_1.FensterPosition.geschlossen) {
62
+ if (pValue === models_1.FensterPosition.geschlossen) {
65
63
  if (this._iOpenTimeout !== undefined) {
66
64
  clearInterval(this._iOpenTimeout);
67
- this.log(logLevel_1.LogLevel.Info, `Fenster nach ${this.minutesOpen} Minuten geschlossen`);
65
+ this.log(models_2.LogLevel.Info, `Fenster nach ${this.minutesOpen} Minuten geschlossen`);
68
66
  this.minutesOpen = 0;
69
67
  this._iOpenTimeout = undefined;
70
68
  }
71
69
  return;
72
70
  }
73
71
  else if (this._iOpenTimeout === undefined) {
74
- this._iOpenTimeout = utils_1.Utils.guardedInterval(() => {
72
+ this._iOpenTimeout = services_1.Utils.guardedInterval(() => {
75
73
  var _a;
76
74
  this.minutesOpen++;
77
75
  const heatgroup = (_a = this._fenster) === null || _a === void 0 ? void 0 : _a.getRoom().HeatGroup;
78
76
  if (heatgroup !== undefined) {
79
77
  const desiredTemp = heatgroup.desiredTemp;
80
78
  const currentTemp = heatgroup.currentTemp;
81
- const outSideTemp = weather_service_1.WeatherService.getCurrentTemp();
79
+ const outSideTemp = services_1.WeatherService.getCurrentTemp();
82
80
  // Check if any of these values are unavailable
83
81
  if (desiredTemp > -99 && currentTemp > -99 && outSideTemp > -99) {
84
82
  const wouldHelp = (desiredTemp < currentTemp && outSideTemp < currentTemp) ||
85
83
  (desiredTemp > currentTemp && outSideTemp > currentTemp);
86
84
  if (!wouldHelp && this._helpingRoomTemp) {
87
85
  const info = `Das Fenster sollte geschlossen werden, es hilft dem Raum nicht mehr`;
88
- this.log(logLevel_1.LogLevel.Info, info);
89
- telegram_service_1.TelegramService.inform(info);
86
+ this.log(models_2.LogLevel.Info, info);
87
+ services_1.TelegramService.inform(info);
90
88
  this._helpingRoomTemp = false;
91
89
  }
92
90
  else if (wouldHelp && !this._helpingRoomTemp) {
93
91
  this._helpingRoomTemp = true;
94
92
  const info = `Das Fenster hilft der Innentemperatur ihr Ziel von ${desiredTemp} zu erreichen. Draußen sind es ${outSideTemp}. Du wirst informiert wenn es nicht mehr hilft.`;
95
- this.log(logLevel_1.LogLevel.Info, info);
96
- telegram_service_1.TelegramService.inform(info);
93
+ this.log(models_2.LogLevel.Info, info);
94
+ services_1.TelegramService.inform(info);
97
95
  return;
98
96
  }
99
97
  else if (wouldHelp && this._helpingRoomTemp) {
@@ -101,18 +99,18 @@ class HmIpGriff extends hmIpDevice_1.HmIPDevice {
101
99
  }
102
100
  }
103
101
  }
104
- const message = `Fenster seit ${this.minutesOpen} Minuten auf Position ${FensterPosition_1.FensterPosition[this.position]}`;
102
+ const message = `Fenster seit ${this.minutesOpen} Minuten auf Position ${models_1.FensterPosition[this.position]}`;
105
103
  switch (this.minutesOpen) {
106
104
  case 15:
107
105
  case 30:
108
106
  case 60:
109
107
  case 120:
110
108
  case 240:
111
- this.log(logLevel_1.LogLevel.Info, message);
112
- telegram_service_1.TelegramService.inform(message);
109
+ this.log(models_2.LogLevel.Info, message);
110
+ services_1.TelegramService.inform(message);
113
111
  break;
114
112
  default:
115
- this.log(logLevel_1.LogLevel.Trace, message);
113
+ this.log(models_2.LogLevel.Trace, message);
116
114
  break;
117
115
  }
118
116
  }, 60000, this);
@@ -2,18 +2,23 @@
2
2
  import { HmIPDevice } from './hmIpDevice';
3
3
  import { DeviceInfo } from '../DeviceInfo';
4
4
  import { HeaterSettings, TemperaturSettings } from '../../../models';
5
- import { iTemperaturSensor } from '../iTemperaturSensor';
6
- import { iHumiditySensor } from '../iHumiditySensor';
7
- import { iHeater } from '../iHeater';
5
+ import { iHeater, iHumiditySensor, iTemperaturSensor } from '../baseDeviceInterfaces';
8
6
  export declare class HmIpHeizgruppe extends HmIPDevice implements iTemperaturSensor, iHumiditySensor, iHeater {
9
7
  settings: HeaterSettings;
10
8
  private _iAutomaticInterval;
9
+ private _initialSeasonCheckDone;
11
10
  private _level;
12
- private _temperatur;
13
11
  private _setPointTemperaturID;
14
12
  private _automaticPoints;
15
13
  private _humidityCallbacks;
14
+ private _temperaturCallbacks;
16
15
  constructor(pInfo: DeviceInfo);
16
+ protected _seasonTurnOff: boolean;
17
+ get seasonTurnOff(): boolean;
18
+ set seasonTurnOff(value: boolean);
19
+ private _temperatur;
20
+ get temperatur(): number;
21
+ private set temperatur(value);
17
22
  private _humidity;
18
23
  get humidity(): number;
19
24
  private set humidity(value);
@@ -24,6 +29,8 @@ export declare class HmIpHeizgruppe extends HmIPDevice implements iTemperaturSen
24
29
  get iLevel(): number;
25
30
  get sTemperatur(): string;
26
31
  get iTemperatur(): number;
32
+ private _roomTemperatur;
33
+ private set roomTemperatur(value);
27
34
  addHumidityCallback(pCallback: (pValue: number) => void): void;
28
35
  deleteAutomaticPoint(name: string): void;
29
36
  getBelongingHeizungen(): iHeater[];
@@ -31,5 +38,8 @@ export declare class HmIpHeizgruppe extends HmIPDevice implements iTemperaturSen
31
38
  update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
32
39
  stopAutomaticCheck(): void;
33
40
  checkAutomaticChange(): void;
41
+ addTempChangeCallback(pCallback: (pValue: number) => void): void;
42
+ onTemperaturChange(newTemperatur: number): void;
34
43
  private updateBaseInformation;
44
+ private checkSeasonTurnOff;
35
45
  }
@@ -5,20 +5,52 @@ const hmIpDevice_1 = require("./hmIpDevice");
5
5
  const deviceType_1 = require("../deviceType");
6
6
  const services_1 = require("../../services");
7
7
  const models_1 = require("../../../models");
8
+ const baseDeviceInterfaces_1 = require("../baseDeviceInterfaces");
8
9
  const device_cluster_type_1 = require("../device-cluster-type");
9
10
  class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
10
11
  constructor(pInfo) {
11
12
  super(pInfo, deviceType_1.DeviceType.HmIpHeizgruppe);
12
13
  this.settings = new models_1.HeaterSettings();
14
+ this._initialSeasonCheckDone = false;
13
15
  this._level = 0;
14
- this._temperatur = 0;
15
16
  this._setPointTemperaturID = '';
16
17
  this._automaticPoints = {};
17
18
  this._humidityCallbacks = [];
19
+ this._temperaturCallbacks = [];
20
+ this._seasonTurnOff = false;
21
+ this._temperatur = baseDeviceInterfaces_1.UNDEFINED_TEMP_VALUE;
18
22
  this._humidity = 0;
19
23
  this._desiredTemperatur = 0;
24
+ this._roomTemperatur = baseDeviceInterfaces_1.UNDEFINED_TEMP_VALUE;
20
25
  this._setPointTemperaturID = `${this.info.fullID}.1.SET_POINT_TEMPERATURE`;
21
26
  this._iAutomaticInterval = services_1.Utils.guardedInterval(this.checkAutomaticChange, 300000, this); // Alle 5 Minuten prüfen
27
+ services_1.TimeCallbackService.addCallback(new models_1.TimeCallback(`${this.info.fullID} Season Check`, models_1.TimeCallbackType.TimeOfDay, () => {
28
+ this.checkSeasonTurnOff();
29
+ }, 0, 2, 0));
30
+ }
31
+ get seasonTurnOff() {
32
+ return this._seasonTurnOff;
33
+ }
34
+ set seasonTurnOff(value) {
35
+ this._seasonTurnOff = value;
36
+ if (value) {
37
+ this.setState(this._setPointTemperaturID, 5);
38
+ }
39
+ else {
40
+ this.setState(this._setPointTemperaturID, this.desiredTemperatur);
41
+ }
42
+ }
43
+ get temperatur() {
44
+ if (this.settings.useOwnTemperatur) {
45
+ return this._temperatur;
46
+ }
47
+ return this._roomTemperatur;
48
+ }
49
+ set temperatur(val) {
50
+ this._temperatur = val;
51
+ for (const cb of this._temperaturCallbacks) {
52
+ cb(val);
53
+ }
22
54
  }
23
55
  get humidity() {
24
56
  return this._humidity;
@@ -33,7 +65,7 @@ class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
33
65
  return this._desiredTemperatur;
34
66
  }
35
67
  set desiredTemperatur(val) {
36
- this.setState(this._setPointTemperaturID, val, () => {
68
+ this.setState(this._setPointTemperaturID, this.seasonTurnOff ? 5 : val, () => {
37
69
  this.log(models_1.LogLevel.Info, `Changed temperature of to "${val}.`);
38
70
  }, (err) => {
39
71
  this.log(models_1.LogLevel.Error, `Temperaturänderung ergab Fehler ${err}.`);
@@ -46,10 +78,13 @@ class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
46
78
  return this._level;
47
79
  }
48
80
  get sTemperatur() {
49
- return `${this._temperatur}°C`;
81
+ return `${this.temperatur}°C`;
50
82
  }
51
83
  get iTemperatur() {
52
- return this._temperatur;
84
+ return this.temperatur;
85
+ }
86
+ set roomTemperatur(value) {
87
+ this._roomTemperatur = value;
53
88
  }
54
89
  addHumidityCallback(pCallback) {
55
90
  this._humidityCallbacks.push(pCallback);
@@ -87,7 +122,10 @@ class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
87
122
  }
88
123
  checkAutomaticChange() {
89
124
  var _a, _b, _c;
90
- if (!this.settings.automaticMode) {
125
+ if (!this._initialSeasonCheckDone) {
126
+ this.checkSeasonTurnOff();
127
+ }
128
+ if (!this.settings.automaticMode || this.seasonTurnOff) {
91
129
  (_a = services_1.Utils.dbo) === null || _a === void 0 ? void 0 : _a.addTemperaturDataPoint(this);
92
130
  return;
93
131
  }
@@ -103,10 +141,19 @@ class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
103
141
  }
104
142
  (_c = services_1.Utils.dbo) === null || _c === void 0 ? void 0 : _c.addTemperaturDataPoint(this);
105
143
  }
144
+ addTempChangeCallback(pCallback) {
145
+ this._temperaturCallbacks.push(pCallback);
146
+ if (this._temperatur > baseDeviceInterfaces_1.UNDEFINED_TEMP_VALUE) {
147
+ pCallback(this._temperatur);
148
+ }
149
+ }
150
+ onTemperaturChange(newTemperatur) {
151
+ this.roomTemperatur = newTemperatur;
152
+ }
106
153
  updateBaseInformation(name, state) {
107
154
  switch (name) {
108
155
  case 'ACTUAL_TEMPERATURE':
109
- this._temperatur = state.val;
156
+ this.temperatur = state.val;
110
157
  break;
111
158
  case 'LEVEL':
112
159
  this._level = state.val;
@@ -120,5 +167,12 @@ class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
120
167
  break;
121
168
  }
122
169
  }
170
+ checkSeasonTurnOff() {
171
+ const desiredState = services_1.Utils.beetweenDays(new Date(), this.settings.seasonTurnOffDay, this.settings.seasonTurnOnDay);
172
+ if (desiredState !== this.seasonTurnOff) {
173
+ this.seasonTurnOff = desiredState;
174
+ }
175
+ this._initialSeasonCheckDone = true;
176
+ }
123
177
  }
124
178
  exports.HmIpHeizgruppe = HmIpHeizgruppe;
@@ -5,11 +5,11 @@ export declare class HmIpHeizung extends HmIPDevice {
5
5
  private _temperatur;
6
6
  private _level;
7
7
  private _adaptionState;
8
+ constructor(pInfo: DeviceInfo);
8
9
  private _desiredTemperatur;
9
10
  get desiredTemperatur(): number;
10
11
  get iLevel(): number;
11
12
  get iTemperatur(): number;
12
- constructor(pInfo: DeviceInfo);
13
13
  update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
14
14
  private updateBaseInformation;
15
15
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HmIpHeizung = void 0;
4
4
  const deviceType_1 = require("../deviceType");
5
- const logLevel_1 = require("../../../models/logLevel");
5
+ const models_1 = require("../../../models");
6
6
  const hmIpDevice_1 = require("./hmIpDevice");
7
7
  var HmIpHeizungAdaptionStates;
8
8
  (function (HmIpHeizungAdaptionStates) {
@@ -33,7 +33,7 @@ class HmIpHeizung extends hmIpDevice_1.HmIPDevice {
33
33
  return this._temperatur;
34
34
  }
35
35
  update(idSplit, state, initial = false) {
36
- this.log(logLevel_1.LogLevel.DeepTrace, `Heizung Update: ID: ${idSplit.join('.')} JSON: ${JSON.stringify(state)}`);
36
+ this.log(models_1.LogLevel.DeepTrace, `Heizung Update: ID: ${idSplit.join('.')} JSON: ${JSON.stringify(state)}`);
37
37
  super.update(idSplit, state, initial, true);
38
38
  switch (idSplit[3]) {
39
39
  case '1':
@@ -53,11 +53,11 @@ class HmIpHeizung extends hmIpDevice_1.HmIPDevice {
53
53
  this._adaptionState = state.val;
54
54
  if (this._adaptionState !== HmIpHeizungAdaptionStates.AdaptionInProgress &&
55
55
  this._adaptionState !== HmIpHeizungAdaptionStates.AdaptionDone) {
56
- this.log(logLevel_1.LogLevel.Alert, `Akward adaption state: ${HmIpHeizungAdaptionStates[this._adaptionState]}`);
56
+ this.log(models_1.LogLevel.Alert, `Akward adaption state: ${HmIpHeizungAdaptionStates[this._adaptionState]}`);
57
57
  }
58
58
  break;
59
59
  case 'SET_POINT_TEMPERATURE':
60
- this.log(logLevel_1.LogLevel.Trace, `Heizung Update Soll-Temperatur JSON: ${JSON.stringify(state)}`);
60
+ this.log(models_1.LogLevel.Trace, `Heizung Update Soll-Temperatur JSON: ${JSON.stringify(state)}`);
61
61
  this._desiredTemperatur = state.val;
62
62
  break;
63
63
  }
@@ -2,7 +2,7 @@
2
2
  import { HmIPDevice } from './hmIpDevice';
3
3
  import { ActuatorSettings, TimeOfDay } from '../../../models';
4
4
  import { DeviceInfo } from '../DeviceInfo';
5
- import { iLamp } from '../iLamp';
5
+ import { iLamp } from '../baseDeviceInterfaces';
6
6
  export declare class HmIpLampe extends HmIPDevice implements iLamp {
7
7
  lightOn: boolean;
8
8
  queuedLightValue: boolean | null;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="iobroker" />
2
2
  import { HmIPDevice } from './hmIpDevice';
3
3
  import { DeviceInfo } from '../DeviceInfo';
4
- import { iIlluminationSensor } from '../iIlluminationSensor';
4
+ import { iIlluminationSensor } from '../baseDeviceInterfaces';
5
5
  export declare class HmIpPraezenz extends HmIPDevice implements iIlluminationSensor {
6
6
  private static PRESENCE_DETECTION;
7
7
  private static CURRENT_ILLUMINATION;
@@ -1,22 +1,22 @@
1
1
  /// <reference types="iobroker" />
2
2
  import { HmIPDevice } from './hmIpDevice';
3
3
  import { DeviceInfo } from '../DeviceInfo';
4
- import { Fenster } from '../groups/Fenster';
5
- import { iShutter } from '../iShutter';
4
+ import { Fenster } from '../groups';
5
+ import { iShutter } from '../baseDeviceInterfaces';
6
6
  import { IoBrokerBaseDevice } from '../IoBrokerBaseDevice';
7
7
  export declare class HmIpRoll extends HmIPDevice implements iShutter {
8
- get currentLevel(): number;
9
- set currentLevel(value: number);
10
- get desiredFensterLevel(): number;
11
- get fenster(): Fenster | undefined;
12
- set fenster(value: Fenster | undefined);
13
- private _currentLevel;
14
8
  private _setLevelSwitchID;
15
- private _fenster?;
16
9
  private _firstCommandRecieved;
17
10
  private _setLevel;
18
11
  private _setLevelTime;
19
12
  constructor(pInfo: DeviceInfo);
13
+ private _currentLevel;
14
+ get currentLevel(): number;
15
+ set currentLevel(value: number);
16
+ private _fenster?;
17
+ get fenster(): Fenster | undefined;
18
+ set fenster(value: Fenster | undefined);
19
+ get desiredFensterLevel(): number;
20
20
  update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
21
21
  setLevel(pPosition: number, initial?: boolean, skipOpenWarning?: boolean): void;
22
22
  toJSON(): Partial<IoBrokerBaseDevice>;