hoffmation-base 3.2.12 → 3.2.15

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.
@@ -86,9 +86,13 @@ class SonosService {
86
86
  logging_1.ServerLogService.writeLog(enums_1.LogLevel.Alert, 'SonosService noch nicht initialisiert.');
87
87
  }
88
88
  polly_service_1.PollyService.tts(pMessage, (networkPath, duration) => {
89
- const hours = new Date().getHours();
90
- const volume = hours < 10 || hours > 22 ? 40 : 80;
91
89
  for (const deviceName in this.ownDevices) {
90
+ const snDevice = this.ownDevices[deviceName];
91
+ const room = snDevice.room;
92
+ const timeOfDay = time_callback_service_1.TimeCallbackService.dayType(room.settings.rolloOffset);
93
+ const volume = timeOfDay == enums_1.TimeOfDay.Night
94
+ ? snDevice.settings.defaultNightAnounceVolume
95
+ : snDevice.settings.defaultDayAnounceVolume;
92
96
  this.ownDevices[deviceName].playOnDevice(networkPath, duration, volumeOverride > -1
93
97
  ? volumeOverride
94
98
  : Math.min(volume, this.ownDevices[deviceName].settings.maxPlayOnAllVolume));
@@ -5,6 +5,18 @@ export declare class SonosDeviceSettings extends DeviceSettings {
5
5
  * @default 80
6
6
  */
7
7
  maxPlayOnAllVolume: number;
8
+ /**
9
+ * The default volume to inform of non critical stuff during daytime
10
+ * @type {number}
11
+ * @default 80
12
+ */
13
+ defaultDayAnounceVolume: number;
14
+ /**
15
+ * The default volume to inform of non critical stuff during nighttime
16
+ * @type {number}
17
+ * @default 80
18
+ */
19
+ defaultNightAnounceVolume: number;
8
20
  fromPartialObject(data: Partial<SonosDeviceSettings>): void;
9
21
  toJSON(): Partial<SonosDeviceSettings>;
10
22
  }
@@ -11,10 +11,24 @@ class SonosDeviceSettings extends deviceSettings_1.DeviceSettings {
11
11
  * @default 80
12
12
  */
13
13
  this.maxPlayOnAllVolume = 80;
14
+ /**
15
+ * The default volume to inform of non critical stuff during daytime
16
+ * @type {number}
17
+ * @default 80
18
+ */
19
+ this.defaultDayAnounceVolume = 80;
20
+ /**
21
+ * The default volume to inform of non critical stuff during nighttime
22
+ * @type {number}
23
+ * @default 80
24
+ */
25
+ this.defaultNightAnounceVolume = 40;
14
26
  }
15
27
  fromPartialObject(data) {
16
- var _a;
28
+ var _a, _b, _c;
17
29
  this.maxPlayOnAllVolume = (_a = data.maxPlayOnAllVolume) !== null && _a !== void 0 ? _a : this.maxPlayOnAllVolume;
30
+ this.defaultDayAnounceVolume = (_b = data.defaultDayAnounceVolume) !== null && _b !== void 0 ? _b : this.defaultDayAnounceVolume;
31
+ this.defaultNightAnounceVolume = (_c = data.defaultNightAnounceVolume) !== null && _c !== void 0 ? _c : this.defaultNightAnounceVolume;
18
32
  super.fromPartialObject(data);
19
33
  }
20
34
  toJSON() {