diff --git a/README.md b/README.md index 43a5c357..0cfb847d 100644 --- a/README.md +++ b/README.md @@ -220,6 +220,12 @@ TBD --> ## Changelog + +### __WORK IN PROGRESS__ +* (@Apollon77) Fixes bridge/device icon display in UI +* (@Apollon77) Prevents displaying warning dialogs when nothing is wrong +* (@Apollon77) Adjusts some logs + ### 0.3.0 (2024-12-20) * BREAKING: Please re-enter your ioBroker Pro Cloud Password! * (@Apollon77) Makes sure the adapter is stopped before being updated diff --git a/src-admin/package-lock.json b/src-admin/package-lock.json index 682f2c71..fa821476 100644 --- a/src-admin/package-lock.json +++ b/src-admin/package-lock.json @@ -1,12 +1,12 @@ { "name": "iobroker.matter", - "version": "0.2.10", + "version": "0.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "iobroker.matter", - "version": "0.2.10", + "version": "0.3.0", "dependencies": { "@foxriver76/iob-component-lib": "^0.2.0", "@iobroker/adapter-react-v5": "^7.4.7", diff --git a/src-admin/src/Tabs/Bridges.tsx b/src-admin/src/Tabs/Bridges.tsx index 73881ce4..d78b76fa 100644 --- a/src-admin/src/Tabs/Bridges.tsx +++ b/src-admin/src/Tabs/Bridges.tsx @@ -310,15 +310,15 @@ export class Bridges extends BridgesAndDevices { } if (anyAdded) { - if (!alreadyExist.length) { + if (!alreadyExist.length && becauseOfLicense.length) { this.setState({ message: `${I18n.t('Following object IDs was not added because of the license')}:${becauseOfLicense.join(', ')}`, }); - } else if (!becauseOfLicense.length) { + } else if (!becauseOfLicense.length && alreadyExist.length) { this.setState({ message: `${I18n.t('Following object IDs was not added because already exists')}:${alreadyExist.join(', ')}`, }); - } else { + } else if (becauseOfLicense.length && alreadyExist.length) { this.setState({ message: `${I18n.t('Following object IDs was not added because of the license')}:${becauseOfLicense.join(', ')}` + @@ -327,12 +327,11 @@ export class Bridges extends BridgesAndDevices { }); } } else { - if (!becauseOfLicense.length) { + if (!becauseOfLicense.length && alreadyExist.length) { this.setState({ message: I18n.t('No devices was added, as they are already in the list') }); - } else if (!alreadyExist.length) { + } else if (!alreadyExist.length && becauseOfLicense.length) { this.setState({ message: I18n.t('No devices was added, as they are not allowed by license') }); } else { - // Actually this branch could not happen this.setState({ message: I18n.t('No devices was added, as they are already in the list or not allowed by license'), }); diff --git a/src-admin/src/Tabs/BridgesAndDevices.tsx b/src-admin/src/Tabs/BridgesAndDevices.tsx index 72554d19..80cd0fde 100644 --- a/src-admin/src/Tabs/BridgesAndDevices.tsx +++ b/src-admin/src/Tabs/BridgesAndDevices.tsx @@ -333,7 +333,7 @@ class BridgesAndDevices ); - if (qrCode) { - result[2] = extendedInfo; - } - if (this.props.nodeStates[deviceOrBridge.uuid].status) { + result[2] = extendedInfo; + + if ( + this.props.nodeStates[deviceOrBridge.uuid].status && + this.props.nodeStates[deviceOrBridge.uuid].status !== 'waitingForCommissioning' && + this.props.nodeStates[deviceOrBridge.uuid].status !== 'creating' + ) { result[0] = ( { } if (anyAdded) { - if (!alreadyExist.length) { + if (!alreadyExist.length && becauseOfLicense.length) { this.setState({ message: `${I18n.t('Following object IDs was not added because of the license')}:${becauseOfLicense.join(', ')}`, }); - } else if (!becauseOfLicense.length) { + } else if (alreadyExist.length && !becauseOfLicense.length) { this.setState({ message: `${I18n.t('Following object IDs was not added because already exists')}:${alreadyExist.join(', ')}`, }); - } else { + } else if (alreadyExist.length && becauseOfLicense.length) { this.setState({ message: `${I18n.t('Following object IDs was not added because of the license')}:${becauseOfLicense.join(', ')}` + @@ -549,12 +549,11 @@ class Devices extends BridgesAndDevices { }); } } else { - if (!becauseOfLicense.length) { + if (alreadyExist && !becauseOfLicense.length) { this.setState({ message: I18n.t('No devices was added, as they are already in the list') }); - } else if (!alreadyExist.length) { + } else if (!alreadyExist.length && becauseOfLicense.length) { this.setState({ message: I18n.t('No devices was added, as they are not allowed by license') }); } else { - // Actually this branch could not happen this.setState({ message: I18n.t('No devices was added, as they are already in the list or not allowed by license'), }); diff --git a/src/main.ts b/src/main.ts index bff672c2..d2956cf2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -381,6 +381,7 @@ export class MatterAdapter extends utils.Adapter { return; } if (this.sendToUI) { + this.log.debug(`Send to GUI: ${JSON.stringify(data)}`); for (let i = 0; i < this.#_guiSubscribes.length; i++) { await this.sendToUI({ clientId: this.#_guiSubscribes[i].clientId, data }); } diff --git a/src/matter/IoBrokerObjectStorage.ts b/src/matter/IoBrokerObjectStorage.ts index 83b28159..0d74340e 100644 --- a/src/matter/IoBrokerObjectStorage.ts +++ b/src/matter/IoBrokerObjectStorage.ts @@ -71,7 +71,7 @@ export class IoBrokerObjectStorage implements MaybeAsyncStorage { } async clear(): Promise { - this.#adapter.log.warn(`[STORAGE] Clearing all storage for ${this.#storageRootOid}`); + this.#adapter.log.info(`[STORAGE] Clearing all storage for ${this.#storageRootOid}`); try { await this.#adapter.delObjectAsync(this.#storageRootOid, { recursive: true }); } catch (error) { @@ -89,7 +89,7 @@ export class IoBrokerObjectStorage implements MaybeAsyncStorage { return; } if (this.#localStorageManager && this.#isLocallyStored(contexts)) { - this.#adapter.log.warn(`[STORAGE] Clearing all storage for ${contexts.join('$$')} in local storage`); + this.#adapter.log.info(`[STORAGE] Clearing all storage for ${contexts.join('$$')} in local storage`); return this.#localStorageManager.clearAll(contexts); } @@ -98,7 +98,7 @@ export class IoBrokerObjectStorage implements MaybeAsyncStorage { startkey: `${contextKey}`, endkey: `${contextKey}\u9999`, }); - this.#adapter.log.warn(`[STORAGE] Clearing all storage (${objs.rows.length} keys found) for ${contextKey}`); + this.#adapter.log.info(`[STORAGE] Clearing all storage (${objs.rows.length} keys found) for ${contextKey}`); const namespaceLen = this.#adapter.namespace.length + 1; for (const state of objs.rows) { if (state.value) { @@ -250,7 +250,6 @@ export class IoBrokerObjectStorage implements MaybeAsyncStorage { } const oid = this.buildKey(contexts, key); - this.#adapter.log.warn(`[STORAGE] Deleting key "${key}" as "${oid}"`); try { await this.#adapter.delObjectAsync(oid); diff --git a/src/matter/to-iobroker/GenericDeviceToIoBroker.ts b/src/matter/to-iobroker/GenericDeviceToIoBroker.ts index dac2a873..5c255b45 100644 --- a/src/matter/to-iobroker/GenericDeviceToIoBroker.ts +++ b/src/matter/to-iobroker/GenericDeviceToIoBroker.ts @@ -569,7 +569,9 @@ export abstract class GenericDeviceToIoBroker { this.#adapter.log.debug(`Node ${this.#node.nodeId} is not connected, do not poll attributes`); } - this.#pollTimeout = setTimeout(() => this.#pollAttributes(attributes), this.#pollInterval); + if (!this.#destroyed) { + this.#pollTimeout = setTimeout(() => this.#pollAttributes(attributes), this.#pollInterval); + } } async destroy(): Promise {