iobroker.iot 4.1.0 → 4.1.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.
Files changed (31) hide show
  1. package/README.md +1 -518
  2. package/admin/assets/{index-Ck_2gqQY.js → index-6Itc0U48.js} +18 -18
  3. package/admin/index_m.html +1 -1
  4. package/build/lib/AlexaSmartHomeV3/Alexa/AlexaResponse.js +6 -0
  5. package/build/lib/AlexaSmartHomeV3/Alexa/AlexaResponse.js.map +1 -1
  6. package/build/lib/AlexaSmartHomeV3/Alexa/ModeValues/Open.js +1 -1
  7. package/build/lib/AlexaSmartHomeV3/Alexa/ModeValues/Open.js.map +1 -1
  8. package/build/lib/AlexaSmartHomeV3/Alexa/Properties/DetectionState.js +6 -0
  9. package/build/lib/AlexaSmartHomeV3/Alexa/Properties/DetectionState.js.map +1 -1
  10. package/build/lib/AlexaSmartHomeV3/Alexa/Properties/LockState.js +20 -0
  11. package/build/lib/AlexaSmartHomeV3/Alexa/Properties/LockState.js.map +1 -1
  12. package/build/lib/AlexaSmartHomeV3/Alexa/Properties/Mode.js +14 -0
  13. package/build/lib/AlexaSmartHomeV3/Alexa/Properties/Mode.js.map +1 -1
  14. package/build/lib/AlexaSmartHomeV3/Alexa/Properties/PowerState.js +6 -0
  15. package/build/lib/AlexaSmartHomeV3/Alexa/Properties/PowerState.js.map +1 -1
  16. package/build/lib/AlexaSmartHomeV3/Controls/AirCondition.js +1 -2
  17. package/build/lib/AlexaSmartHomeV3/Controls/AirCondition.js.map +1 -1
  18. package/build/lib/AlexaSmartHomeV3/Controls/Lock.js +1 -1
  19. package/build/lib/AlexaSmartHomeV3/Controls/Lock.js.map +1 -1
  20. package/build/lib/AlexaSmartHomeV3/DeviceManager.js +16 -10
  21. package/build/lib/AlexaSmartHomeV3/DeviceManager.js.map +1 -1
  22. package/build/lib/AlexaSmartHomeV3/Helpers/FileHelper.js +1 -3
  23. package/build/lib/AlexaSmartHomeV3/Helpers/FileHelper.js.map +1 -1
  24. package/build/lib/AlexaSmartHomeV3/Helpers/RateLimiter.js +23 -16
  25. package/build/lib/AlexaSmartHomeV3/Helpers/RateLimiter.js.map +1 -1
  26. package/build/lib/AlexaSmartHomeV3/Helpers/Utils.js +0 -1
  27. package/build/lib/AlexaSmartHomeV3/Helpers/Utils.js.map +1 -1
  28. package/build/main.js +23 -3
  29. package/build/main.js.map +1 -1
  30. package/io-package.json +14 -14
  31. package/package.json +2 -2
package/build/main.js CHANGED
@@ -737,12 +737,13 @@ class IotAdapter extends adapter_core_1.Adapter {
737
737
  if (request instanceof Buffer) {
738
738
  request = request.toString();
739
739
  }
740
- this.log.debug(`Data: ${JSON.stringify(request)}`);
741
740
  if (!request || !type) {
741
+ this.log.debug(`Invalid request: ${JSON.stringify(request)}`);
742
742
  return { error: 'invalid request' };
743
743
  }
744
744
  if (type.startsWith('remote')) {
745
745
  const start = Date.now();
746
+ this.log.debug(`Remote request: ${JSON.stringify(request)}`);
746
747
  if (this.remote) {
747
748
  return this.remote
748
749
  .process(request, type)
@@ -760,6 +761,7 @@ class IotAdapter extends adapter_core_1.Adapter {
760
761
  this.log.error(`Received command, but remote already closed.`);
761
762
  }
762
763
  else if (type.startsWith('nightscout')) {
764
+ this.log.debug(`Nightscout request: ${JSON.stringify(request)}`);
763
765
  if (this.config.nightscout) {
764
766
  const state = await this.getForeignStateAsync(`system.adapter.nightscout.${this.config.nightscout}.alive`);
765
767
  if (state?.val) {
@@ -779,7 +781,14 @@ class IotAdapter extends adapter_core_1.Adapter {
779
781
  return { error: 'Cannot parse request' };
780
782
  }
781
783
  }
782
- this.log.debug(`${Date.now()} ALEXA: ${JSON.stringify(request)}`);
784
+ const printRequest = JSON.parse(JSON.stringify(request));
785
+ if (printRequest.directive?.header?.correlationToken) {
786
+ printRequest.directive.header.correlationToken = '***';
787
+ }
788
+ if (printRequest.directive?.endpoint?.scope?.token) {
789
+ printRequest.directive.endpoint.scope.token = '***';
790
+ }
791
+ this.log.debug(`${Date.now()} ALEXA: ${JSON.stringify(printRequest)}`);
783
792
  if (request?.directive) {
784
793
  if (this.alexaSH3) {
785
794
  try {
@@ -829,6 +838,7 @@ class IotAdapter extends adapter_core_1.Adapter {
829
838
  this.log.error(`Cannot parse request: ${request}`);
830
839
  return { error: 'Cannot parse request' };
831
840
  }
841
+ this.log.debug(`IFTTT request: ${JSON.stringify(request)}`);
832
842
  await this.processIfttt(request);
833
843
  return NONE;
834
844
  }
@@ -842,6 +852,7 @@ class IotAdapter extends adapter_core_1.Adapter {
842
852
  return { error: 'Cannot parse request' };
843
853
  }
844
854
  }
855
+ this.log.debug(`[GHOME] request: ${JSON.stringify(request)}`);
845
856
  if (this.googleHome) {
846
857
  return this.googleHome.process(request, this.config.googleHome);
847
858
  }
@@ -857,6 +868,7 @@ class IotAdapter extends adapter_core_1.Adapter {
857
868
  return { error: 'Cannot parse request' };
858
869
  }
859
870
  }
871
+ this.log.debug(`[ALISA] request: ${JSON.stringify(request)}`);
860
872
  this.log.debug(`${Date.now()} ALISA: ${JSON.stringify(request)}`);
861
873
  if (this.yandexAlisa) {
862
874
  return this.yandexAlisa.process(request, this.config.yandexAlisa);
@@ -909,6 +921,7 @@ class IotAdapter extends adapter_core_1.Adapter {
909
921
  else {
910
922
  request = request.toString();
911
923
  }
924
+ this.log.debug(`Custom request: ${JSON.stringify(request)}`);
912
925
  if (SPECIAL_ADAPTERS.includes(_type)) {
913
926
  try {
914
927
  await this.setStateAsync(`services.${_type}`, request, true);
@@ -1082,7 +1095,14 @@ class IotAdapter extends adapter_core_1.Adapter {
1082
1095
  }
1083
1096
  }
1084
1097
  else {
1085
- this.log.debug(`[REMOTE] Send response to 'response/${clientId}/${type}: ${JSON.stringify(response)}`);
1098
+ const printResponse = JSON.parse(JSON.stringify(response));
1099
+ if (printResponse?.event?.header?.correlationToken) {
1100
+ printResponse.event.header.correlationToken = '***';
1101
+ }
1102
+ if (printResponse?.event?.endpoint?.scope?.token) {
1103
+ printResponse.event.endpoint.scope.token = '***';
1104
+ }
1105
+ this.log.debug(`[REMOTE] Response to 'response/${clientId}/${type}: ${JSON.stringify(printResponse)}`);
1086
1106
  const msg = JSON.stringify(response);
1087
1107
  if (msg && msg.length > MAX_IOT_MESSAGE_LENGTH) {
1088
1108
  const packed = (0, node_zlib_1.deflateSync)(msg).toString('base64');