homebridge-zwave-usb 3.6.6 → 3.6.7

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.
@@ -33,6 +33,18 @@ class MultilevelSensorFeature extends ZWaveFeature_1.BaseFeature {
33
33
  .getCharacteristic(this.platform.Characteristic.CurrentAmbientLightLevel)
34
34
  .onGet(() => Math.max(this.getSensorValue('Illuminance') ?? 0.0001, 0.0001));
35
35
  }
36
+ if (this.hasSensorType('Ultraviolet')) {
37
+ if (!this.lightService) {
38
+ this.lightService = this.getService(this.platform.Service.LightSensor, undefined, subType);
39
+ }
40
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
+ const uvChar = this.platform.Characteristic.UVIndex;
42
+ if (uvChar) {
43
+ this.lightService
44
+ .getCharacteristic(uvChar)
45
+ .onGet(() => this.getSensorValue('Ultraviolet') ?? 0);
46
+ }
47
+ }
36
48
  if (this.hasSensorType('Carbon dioxide (CO2) level')) {
37
49
  this.carbonDioxideService = this.getService(this.platform.Service.CarbonDioxideSensor, undefined, subType);
38
50
  this.carbonDioxideService
@@ -84,6 +96,12 @@ class MultilevelSensorFeature extends ZWaveFeature_1.BaseFeature {
84
96
  if (val !== undefined) {
85
97
  this.lightService.updateCharacteristic(this.platform.Characteristic.CurrentAmbientLightLevel, Math.max(val, 0.0001));
86
98
  }
99
+ const uvVal = this.getSensorValue('Ultraviolet');
100
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
101
+ const uvChar = this.platform.Characteristic.UVIndex;
102
+ if (uvVal !== undefined && uvChar) {
103
+ this.lightService.updateCharacteristic(uvChar, uvVal);
104
+ }
87
105
  }
88
106
  if (this.airQualityService) {
89
107
  try {
@@ -285,7 +285,24 @@ class ZWaveUsbPlatform {
285
285
  this.value = 0;
286
286
  }
287
287
  };
288
- // 3. Z-Wave Manager Service
288
+ // 3. UV Index Characteristic
289
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
290
+ Characteristic.UVIndex = class extends Characteristic {
291
+ static UUID = settings_1.UV_INDEX_CHAR_UUID;
292
+ constructor() {
293
+ super('UV Index', settings_1.UV_INDEX_CHAR_UUID, {
294
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
295
+ format: settings_1.HAPFormat.FLOAT,
296
+ minValue: 0,
297
+ maxValue: 100,
298
+ minStep: 0.1,
299
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
300
+ perms: [settings_1.HAPPerm.PAIRED_READ, settings_1.HAPPerm.NOTIFY],
301
+ });
302
+ this.value = 0;
303
+ }
304
+ };
305
+ // 4. Z-Wave Manager Service
289
306
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
290
307
  Service.ZWaveManager = class extends Service {
291
308
  static UUID = settings_1.MANAGER_SERVICE_UUID;
@@ -3,6 +3,7 @@ export declare const PLATFORM_NAME = "ZWaveUSB";
3
3
  export declare const MANAGER_SERVICE_UUID = "9b0f7a10-6b3d-4fe8-8f6c-7e99b2d4a101";
4
4
  export declare const STATUS_CHAR_UUID = "9b0f7a10-6b3d-4fe8-8f6c-7e99b2d4a102";
5
5
  export declare const PIN_CHAR_UUID = "9b0f7a10-6b3d-4fe8-8f6c-7e99b2d4a104";
6
+ export declare const UV_INDEX_CHAR_UUID = "E863F129-079E-48FF-8F27-9C2605A29F52";
6
7
  export declare enum HAPFormat {
7
8
  STRING = "string",
8
9
  BOOL = "bool",
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OBSOLETE_CHAR_UUIDS = exports.OBSOLETE_MANAGER_UUIDS = exports.HAPPerm = exports.HAPFormat = exports.PIN_CHAR_UUID = exports.STATUS_CHAR_UUID = exports.MANAGER_SERVICE_UUID = exports.PLATFORM_NAME = exports.PLUGIN_NAME = void 0;
3
+ exports.OBSOLETE_CHAR_UUIDS = exports.OBSOLETE_MANAGER_UUIDS = exports.HAPPerm = exports.HAPFormat = exports.UV_INDEX_CHAR_UUID = exports.PIN_CHAR_UUID = exports.STATUS_CHAR_UUID = exports.MANAGER_SERVICE_UUID = exports.PLATFORM_NAME = exports.PLUGIN_NAME = void 0;
4
4
  exports.PLUGIN_NAME = 'homebridge-zwave-usb';
5
5
  exports.PLATFORM_NAME = 'ZWaveUSB';
6
6
  // Custom UUIDs - Version 9
@@ -8,6 +8,7 @@ exports.PLATFORM_NAME = 'ZWaveUSB';
8
8
  exports.MANAGER_SERVICE_UUID = '9b0f7a10-6b3d-4fe8-8f6c-7e99b2d4a101';
9
9
  exports.STATUS_CHAR_UUID = '9b0f7a10-6b3d-4fe8-8f6c-7e99b2d4a102';
10
10
  exports.PIN_CHAR_UUID = '9b0f7a10-6b3d-4fe8-8f6c-7e99b2d4a104';
11
+ exports.UV_INDEX_CHAR_UUID = 'E863F129-079E-48FF-8F27-9C2605A29F52';
11
12
  // HAP Constants (Enums for cleaner code)
12
13
  var HAPFormat;
13
14
  (function (HAPFormat) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "homebridge-zwave-usb",
3
3
  "displayName": "Homebridge Z-Wave USB",
4
- "version": "3.6.6",
4
+ "version": "3.6.7",
5
5
  "description": "A Homebridge dynamic platform plugin for Z-Wave USB controllers using zwave-js.",
6
6
  "license": "Polyform-Noncommercial-1.0.0",
7
7
  "funding": {