Skip to content

Commit

Permalink
latest update lib and Async Storage
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 committed Jul 7, 2024
1 parent ecb0062 commit 0dce81e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
"url": "https://github.com/ioBroker/ioBroker.matter"
},
"optionalDependencies": {
"@project-chip/matter-node-ble.js": "0.10.0-alpha.0-20240706-499c48e8"
"@project-chip/matter-node-ble.js": "0.10.0-alpha.0-20240707-ccb2eb3c"
},
"dependencies": {
"@iobroker/adapter-core": "^3.1.6",
"@project-chip/matter.js": "0.10.0-alpha.0-20240706-499c48e8",
"@project-chip/matter-node.js": "0.10.0-alpha.0-20240706-499c48e8",
"@project-chip/matter.js": "0.10.0-alpha.0-20240707-ccb2eb3c",
"@project-chip/matter-node.js": "0.10.0-alpha.0-20240707-ccb2eb3c",
"@iobroker/type-detector": "^3.0.5",
"@iobroker/dm-utils": "^0.2.2",
"axios": "^1.7.2",
Expand Down
8 changes: 4 additions & 4 deletions src/matter/ControllerNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class Controller {
},
});

await this.adapter.setState('controller.info.discovering', false);
await this.adapter.setState('controller.info.discovering', false, true);

await this.commissioningController.start();

Expand Down Expand Up @@ -719,7 +719,7 @@ class Controller {
const nodeObject = this.commissioningController.getConnectedNode(nodeId);
if (nodeObject === undefined) {
// should never happen
throw new Error(`Node ${nodeId} not found connected but commissioning was successful.`);
throw new Error(`Node ${nodeId} is not connected but commissioning was successful. Should never happen.`);
}

await this.nodeToIoBrokerStructure(nodeObject);
Expand All @@ -736,7 +736,7 @@ class Controller {
if (!this.commissioningController) {
return null;
}
await this.adapter.setState('controller.info.discovering', { val: true, ack: true } );
await this.adapter.setState('controller.info.discovering', true, true );
this.discovering = true;
this.adapter.log.info(`Start the discovering...`);
const result = await this.commissioningController.discoverCommissionableDevices(
Expand Down Expand Up @@ -767,7 +767,7 @@ class Controller {
if (this.commissioningController && this.discovering) {
this.adapter.log.info(`Stop the discovering...`);
this.discovering = false;
await this.adapter.setState('controller.info.discovering', { val: false, ack: true });
await this.adapter.setState('controller.info.discovering', false, true);
this.commissioningController.cancelCommissionableDeviceDiscovery(
{},
{
Expand Down
8 changes: 4 additions & 4 deletions src/matter/IoBrokerNodeStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class IoBrokerNodeStorage implements MaybeAsyncStorage {
try {
await this.adapter.delObjectAsync(this.storageRootOid, { recursive: true });
} catch (error) {
this.adapter.log.error(`[STORAGE] Cannot clear all state: ${error}`);
this.adapter.log.error(`[STORAGE] Cannot clear all state: ${error.message}`);
}
this.existingObjectIds.clear();
this.clear = false;
Expand All @@ -77,12 +77,12 @@ export class IoBrokerNodeStorage implements MaybeAsyncStorage {
return undefined;
}
if (typeof valueState.val !== 'string') {
this.adapter.log.error(`[STORAGE] Invalid value for key ${key} in context ${contexts.join('$$')}: ${toJson(valueState.val)}`);
this.adapter.log.error(`[STORAGE] Invalid value for key "${key}" in context "${contexts.join('$$')}": ${toJson(valueState.val)}`);
return undefined;
}
return fromJson(valueState.val) as T;
} catch (error) {
this.adapter.log.error(`[STORAGE] Cannot read state: ${error}`);
this.adapter.log.error(`[STORAGE] Cannot read state: ${error.message}`);
}
}

Expand Down Expand Up @@ -168,7 +168,7 @@ export class IoBrokerNodeStorage implements MaybeAsyncStorage {
try {
await this.adapter.delObjectAsync(oid);
} catch (error) {
this.adapter.log.error(`[STORAGE] Cannot delete state: ${error}`);
this.adapter.log.error(`[STORAGE] Cannot delete state: ${error.message}`);
}
this.existingObjectIds.delete(oid);
}
Expand Down

0 comments on commit 0dce81e

Please sign in to comment.