Skip to content

Commit

Permalink
Fixes and enhancements 06.12 (#200)
Browse files Browse the repository at this point in the history
* again package-lock

* Fix noCompose in UI

* null is allowed

* use correct update methods for update

* add convenience methods

* DM fixes

* Deszroy all matter event listeners on device destroy

The _a/_b are needed till next matter,js update and can then be removed

* Declare reachable state to be able to change it

* Fixes object change handling

* Allow Bridges to expose its name

* README.md

* matter.js update

* typing change

* Optimize object queue again

* Fixes renaming of nodes and devices

* Fix object processing vs unload

* Fix debugging change
  • Loading branch information
Apollon77 authored Dec 6, 2024
1 parent ba0228e commit 0be7dd6
Show file tree
Hide file tree
Showing 20 changed files with 224 additions and 116 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@ TBD
-->

## Changelog

### __WORK IN PROGRESS__
* (@Apollon77) Sets the "no-compose" flag correctly to normally use composed if needed and adds it to a missing dialog
* (@Apollon77) Allows to use null values if needed
* (@Apollon77) Fixes UNREACH handling for devices
* (@Apollon77) Fixes object change handling for controller
* (@Apollon77) Allow Bridges to expose its name as a device name
* (@Apollon77) Allows to rename controller nodes and devices

### 0.2.4 (2024-12-04)
* (@Apollon77) Shows a progress indicator when deleting controller nodes
* (@Apollon77) Cuts names and labels to 32 or 64 characters as needed by Matter
Expand Down
118 changes: 59 additions & 59 deletions package-lock.json

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
"url": "https://github.com/ioBroker/ioBroker.matter"
},
"optionalDependencies": {
"@matter/nodejs-ble": "0.11.8"
"@matter/nodejs-ble": "0.11.9-alpha.0-20241206-22f233334"
},
"dependencies": {
"@iobroker/adapter-core": "^3.2.2",
"@iobroker/i18n": "^0.3.1",
"@iobroker/dm-utils": "^0.6.9",
"@iobroker/type-detector": "^4.0.1",
"@matter/main": "0.11.8",
"@matter/nodejs": "0.11.8",
"@project-chip/matter.js": "0.11.8",
"@matter/main": "0.11.9-alpha.0-20241206-22f233334",
"@matter/nodejs": "0.11.9-alpha.0-20241206-22f233334",
"@project-chip/matter.js": "0.11.9-alpha.0-20241206-22f233334",
"axios": "^1.7.8",
"jsonwebtoken": "^9.0.2"
},
Expand Down
4 changes: 2 additions & 2 deletions src-admin/package-lock.json

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

27 changes: 26 additions & 1 deletion src-admin/src/Tabs/Bridges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ interface AddCustomDeviceDialog {
detectedDeviceType?: Types;
bridgeIndex: number;
hasOnState?: boolean;
noComposed?: boolean;
}

interface BridgesState extends BridgesAndDevicesState {
Expand Down Expand Up @@ -272,7 +273,7 @@ export class Bridges extends BridgesAndDevices<BridgesProps, BridgesState> {
oid: device._id,
type: device.deviceType,
enabled: true,
noComposed: true,
noComposed: !!device.noComposed,
auto: isAutoDetected,
actionAllowedByIdentify: false,
};
Expand Down Expand Up @@ -783,6 +784,7 @@ export class Bridges extends BridgesAndDevices<BridgesProps, BridgesState> {
name,
deviceType: '',
bridgeIndex: this.bridgeIndex as number,
noComposed: false,
},
});
} else {
Expand All @@ -801,6 +803,7 @@ export class Bridges extends BridgesAndDevices<BridgesProps, BridgesState> {
deviceType: SUPPORTED_DEVICES.includes(deviceType) ? deviceType : '',
bridgeIndex: this.bridgeIndex as number,
hasOnState: controls[0].devices[0].hasOnState,
noComposed: false,
},
});
}
Expand Down Expand Up @@ -988,6 +991,27 @@ export class Bridges extends BridgesAndDevices<BridgesProps, BridgesState> {
))}
</Select>
</FormControl>
<FormControlLabel
control={
<Checkbox
checked={this.state.addCustomDeviceDialog.noComposed}
onChange={e => {
if (!this.state.addCustomDeviceDialog) {
return;
}

const addCustomDeviceDialog = clone(this.state.addCustomDeviceDialog);
addCustomDeviceDialog.noComposed = e.target.checked;
this.setState({ addCustomDeviceDialog });
}}
/>
}
label={
<span style={{ fontSize: 'smaller' }}>
{I18n.t('Do not compose devices (Alexa does not support composed devices yet)')}
</span>
}
/>
</DialogContent>
<DialogActions>
<Button
Expand All @@ -1007,6 +1031,7 @@ export class Bridges extends BridgesAndDevices<BridgesProps, BridgesState> {
deviceType: (addCustomDeviceDialog.deviceType ??
addCustomDeviceDialog.detectedDeviceType) as Types,
hasOnState: addCustomDeviceDialog.hasOnState,
noComposed: !!addCustomDeviceDialog.noComposed,
// ignored
type: 'device',
states: [],
Expand Down
5 changes: 4 additions & 1 deletion src-admin/src/Tabs/Devices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ class Devices extends BridgesAndDevices<DevicesProps, DevicesState> {
auto: isAutoDetected,
productID: device.productID || '0x8000',
vendorID: device.vendorID || '0xFFF1',
noComposed: true,
noComposed: !!device.noComposed,
enabled: true,
actionAllowedByIdentify: false,
};
Expand Down Expand Up @@ -673,6 +673,9 @@ class Devices extends BridgesAndDevices<DevicesProps, DevicesState> {
deviceType: (addCustomDeviceDialog.deviceType ??
addCustomDeviceDialog.detectedDeviceType) as Types,
hasOnState: !!addCustomDeviceDialog.hasOnState,
noComposed: !!addCustomDeviceDialog.noComposed,
productID: addCustomDeviceDialog.productID,
vendorID: addCustomDeviceDialog.vendorID,
// ignored
type: 'device',
states: [],
Expand Down
1 change: 1 addition & 0 deletions src-admin/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export interface DetectedDevice {
vendorID?: string;
productID?: string;
auto?: boolean;
noComposed?: boolean;
}

export interface DetectedRoom {
Expand Down
Loading

0 comments on commit 0be7dd6

Please sign in to comment.