hoffmation-base 2.18.1 → 2.18.3

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.
@@ -19,7 +19,7 @@ class DeviceUpdater {
19
19
  }
20
20
  }
21
21
  updateState(id, state, initial = false) {
22
- var _a;
22
+ var _a, _b;
23
23
  if (state === null) {
24
24
  // Ignore null states
25
25
  return;
@@ -30,7 +30,7 @@ class DeviceUpdater {
30
30
  if (idSplit[0] == 'mqtt') {
31
31
  mqtt_1.MqttCoordinator.update(idSplit, state);
32
32
  }
33
- const device = devices_1.Devices.alLDevices[`${idSplit[0]}-${idSplit[2]}`];
33
+ const device = (_a = devices_1.Devices.alLDevices[`${idSplit[0]}-${idSplit[2]}`]) !== null && _a !== void 0 ? _a : devices_1.Devices.alLDevices[`${idSplit[0]}-${idSplit[2].substring(2)}`];
34
34
  if (typeof device === 'undefined' || device.update === undefined) {
35
35
  return;
36
36
  }
@@ -38,7 +38,7 @@ class DeviceUpdater {
38
38
  device.update(idSplit, state, initial, false);
39
39
  }
40
40
  catch (e) {
41
- services_1.ServerLogService.writeLog(models_1.LogLevel.Alert, `deviceUpdater.updateState('${id}', '${state}'): Error occured updating Device: ${e} \n ${(_a = e === null || e === void 0 ? void 0 : e.stack) !== null && _a !== void 0 ? _a : ''}`);
41
+ services_1.ServerLogService.writeLog(models_1.LogLevel.Alert, `deviceUpdater.updateState('${id}', '${state}'): Error occured updating Device: ${e} \n ${(_b = e === null || e === void 0 ? void 0 : e.stack) !== null && _b !== void 0 ? _b : ''}`);
42
42
  }
43
43
  }
44
44
  }
@@ -131,7 +131,8 @@ class Devices {
131
131
  }
132
132
  static processZigbeeDevice(cDevConf) {
133
133
  const zigbeeInfo = new IoBrokerDeviceInfo_1.IoBrokerDeviceInfo(cDevConf);
134
- const fullName = `${Devices.IDENTIFIER_ZIGBEE}-${zigbeeInfo.devID}`;
134
+ const apiDevId = zigbeeInfo.devID.startsWith('0x') ? zigbeeInfo.devID.substring(2) : zigbeeInfo.devID;
135
+ const fullName = `${Devices.IDENTIFIER_ZIGBEE}-${apiDevId}`;
135
136
  zigbeeInfo.allDevicesKey = fullName;
136
137
  if (typeof Devices.alLDevices[fullName] !== 'undefined') {
137
138
  return;