@iobroker/adapter-react-v5 6.1.1 → 6.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.
@@ -129,7 +129,7 @@ declare class Connection {
129
129
  private onCmdStdoutHandler;
130
130
  private onCmdStderrHandler;
131
131
  private onCmdExitHandler;
132
- systemConfig: ioBroker.Object | null;
132
+ systemConfig: ioBroker.SystemConfigObject | null;
133
133
  constructor(props: ConnectionProps);
134
134
  /**
135
135
  * Checks if this connection is running in a web adapter and not in an admin.
@@ -680,11 +680,11 @@ declare class Connection {
680
680
  * @param {boolean} [update] Force update.
681
681
  * @returns {Promise<ioBroker.OtherObject>}
682
682
  */
683
- getSystemConfig(update?: boolean): Promise<ioBroker.Object>;
683
+ getSystemConfig(update?: boolean): Promise<ioBroker.SystemConfigObject>;
684
684
  /**
685
685
  * Sets the system configuration.
686
686
  */
687
- setSystemConfig(obj: ioBroker.SettableObjectWorker<ioBroker.Object>): Promise<ioBroker.SettableObjectWorker<ioBroker.Object>>;
687
+ setSystemConfig(obj: ioBroker.SettableObjectWorker<ioBroker.SystemConfigObject>): Promise<ioBroker.SystemConfigObject>;
688
688
  /**
689
689
  * Get the raw socket.io socket.
690
690
  */
@@ -835,7 +835,7 @@ declare class Connection {
835
835
  */
836
836
  getCompactInstalled(host: string, update?: boolean, cmdTimeout?: number): Promise<Record<string, ioBroker.AdapterObject>>;
837
837
  getCompactSystemRepositories(update?: boolean, cmdTimeout?: number): Promise<ioBroker.Object>;
838
- getCompactSystemConfig(update?: boolean): Promise<ioBroker.Object>;
838
+ getCompactSystemConfig(update?: boolean): Promise<ioBroker.SystemConfigObject>;
839
839
  /**
840
840
  * Get the repository in compact form (only version and icon).
841
841
  * @param {string} host
@@ -2204,8 +2204,8 @@ class Connection {
2204
2204
  return Promise.reject(NOT_CONNECTED);
2205
2205
  }
2206
2206
  this._promises.systemConfig = this.getObject('system.config')
2207
- .then(systemConfig => {
2208
- systemConfig = systemConfig || {};
2207
+ .then(obj => {
2208
+ const systemConfig = (obj || {});
2209
2209
  systemConfig.common = systemConfig.common || {};
2210
2210
  systemConfig.native = systemConfig.native || {};
2211
2211
  return systemConfig;
@@ -2692,16 +2692,16 @@ class Connection {
2692
2692
  }
2693
2693
  // returns very optimized information for adapters to minimize a connection load
2694
2694
  getCompactSystemConfig(update) {
2695
- if (!update && this._promises.systemConfigCommon) {
2696
- return this._promises.systemConfigCommon;
2695
+ if (!update && this._promises.systemConfigPromise) {
2696
+ return this._promises.systemConfigPromise;
2697
2697
  }
2698
2698
  if (!this.connected) {
2699
2699
  return Promise.reject(NOT_CONNECTED);
2700
2700
  }
2701
- this._promises.systemConfigCommon = new Promise((resolve, reject) => {
2701
+ this._promises.systemConfigPromise = new Promise((resolve, reject) => {
2702
2702
  this._socket.emit('getCompactSystemConfig', (err, systemConfig) => (err ? reject(err) : resolve(systemConfig)));
2703
2703
  });
2704
- return this._promises.systemConfigCommon;
2704
+ return this._promises.systemConfigPromise;
2705
2705
  }
2706
2706
  /**
2707
2707
  * Get the repository in compact form (only version and icon).
package/README.md CHANGED
@@ -781,6 +781,9 @@ The best practice is to replace `padding` with `p` and `margin` with `m`, so you
781
781
  -->
782
782
 
783
783
  ## Changelog
784
+ ### 6.1.2 (2024-07-20)
785
+ * (bluefox) Better typing of legacy connection
786
+
784
787
  ### 6.1.1 (2024-07-16)
785
788
  * (bluefox) Added translations
786
789
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/adapter-react-v5",
3
- "version": "6.1.1",
3
+ "version": "6.1.2",
4
4
  "description": "React classes to develop admin interfaces for ioBroker with react.",
5
5
  "author": {
6
6
  "name": "Denis Haev (bluefox)",