hoffmation-base 3.3.1 → 3.3.2

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.
@@ -25,4 +25,5 @@ export declare class TimeCallback implements ITimeCallback {
25
25
  constructor(name: string, type: TimeCallbackType, cFunction: () => void, minuteOffset: number, hours?: number | undefined, minutes?: number | undefined, sunTimeOffset?: SunTimeOffsets | undefined, cloudOffset?: number | undefined);
26
26
  recalcNextToDo(now: Date): void;
27
27
  perform(now?: Date): void;
28
+ toJSON(): Partial<TimeCallback>;
28
29
  }
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.TimeCallback = void 0;
4
7
  const enums_1 = require("../enums");
5
8
  const services_1 = require("../services");
6
9
  const utils_1 = require("../utils");
7
10
  const logging_1 = require("../logging");
11
+ const lodash_1 = __importDefault(require("lodash"));
8
12
  class TimeCallback {
9
13
  get calculationSunrise() {
10
14
  var _a;
@@ -112,5 +116,8 @@ class TimeCallback {
112
116
  this._calculationSunset = undefined;
113
117
  this.cFunction();
114
118
  }
119
+ toJSON() {
120
+ return utils_1.Utils.jsonFilter(lodash_1.default.omit(this, ['cFunction']));
121
+ }
115
122
  }
116
123
  exports.TimeCallback = TimeCallback;
@@ -1,9 +1,9 @@
1
1
  import { BaseGroup, DeviceCluster, HeatGroup, TasterGroup, WaterGroup } from '../devices';
2
2
  import { RoomSetLightTimeBasedCommand } from '../command';
3
- import { iIdHolder, iLightGroup, iPresenceGroup, iRoomBase, iSmokeGroup, iSpeakerGroup, ITimeCallback, iTrilaterationPoint, iWindowGroup } from '../interfaces';
3
+ import { iIdHolder, iJsonCustomPrepend, iLightGroup, iPresenceGroup, iRoomBase, iSmokeGroup, iSpeakerGroup, ITimeCallback, iTrilaterationPoint, iWindowGroup } from '../interfaces';
4
4
  import { GroupType, LogLevel } from '../enums';
5
5
  import { RoomInfo, RoomSettingsController } from '../models';
6
- export declare class RoomBase implements iRoomBase, iIdHolder {
6
+ export declare class RoomBase implements iRoomBase, iIdHolder, iJsonCustomPrepend {
7
7
  groupMap: Map<GroupType, BaseGroup>;
8
8
  startPoint?: iTrilaterationPoint | undefined;
9
9
  endPoint?: iTrilaterationPoint | undefined;
@@ -49,6 +49,7 @@ export declare class RoomBase implements iRoomBase, iIdHolder {
49
49
  */
50
50
  setLightTimeBased(c: RoomSetLightTimeBasedCommand): void;
51
51
  isNowLightTime(): boolean;
52
+ customPrepend(): Partial<unknown>;
52
53
  toJSON(): Partial<iRoomBase & {
53
54
  /**
54
55
  * The dictionary representation of the group map
@@ -164,8 +164,22 @@ class RoomBase {
164
164
  }
165
165
  return time_callback_service_1.TimeCallbackService.darkOutsideOrNight(timeOfDay);
166
166
  }
167
+ customPrepend() {
168
+ return {
169
+ sunriseShutterCallback: this.sunriseShutterCallback,
170
+ sunsetShutterCallback: this.sunsetShutterCallback,
171
+ sonnenUntergangLichtCallback: this.sonnenUntergangLichtCallback,
172
+ sonnenAufgangLichtCallback: this.sonnenAufgangLichtCallback,
173
+ };
174
+ }
167
175
  toJSON() {
168
- return utils_1.Utils.jsonFilter(lodash_1.default.omit(this, ['_deviceCluster']));
176
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
177
+ const result = utils_1.Utils.jsonFilter(lodash_1.default.omit(this, ['_deviceCluster']));
178
+ result['sunriseShutterCallback'] = this.sunriseShutterCallback;
179
+ result['sunsetShutterCallback'] = this.sunsetShutterCallback;
180
+ result['sonnenUntergangLichtCallback'] = this.sonnenUntergangLichtCallback;
181
+ result['sonnenAufgangLichtCallback'] = this.sonnenAufgangLichtCallback;
182
+ return result;
169
183
  }
170
184
  log(level, message) {
171
185
  logging_1.ServerLogService.writeLog(level, message, {