Skip to content

Commit 84fce24

Browse files
committed
added getCachedMatterAccessories() method
1 parent e2613c1 commit 84fce24

4 files changed

Lines changed: 32 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to `@homebridge/plugin-ui-utils` will be documented in this file. This project tries to adhere to [Semantic Versioning](http://semver.org/).
44

5+
## v2.1.4 (Unreleased)
6+
7+
### Changes
8+
9+
- added `getCachedMatterAccessories()` method
10+
511
## v2.1.3 (2026-02-08)
612

713
### Changes

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,16 @@ Returns the cached accessories for the plugin.
186186
const cachedAccessories = await homebridge.getCachedAccessories()
187187
```
188188

189+
#### `homebridge.getCachedMatterAccessories`
190+
191+
> `homebridge.getCachedMatterAccessories(): Promise<CachedMatterAccessory[]>;`
192+
193+
Returns the cached Matter accessories for the plugin.
194+
195+
```ts
196+
const cachedMatterAccessories = await homebridge.getCachedMatterAccessories()
197+
```
198+
189199
### Environment
190200

191201
#### `homebridge.i18nCurrentLang`

src/ui.interface.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,21 @@ export interface CachedAccessory {
7171
services: any[]
7272
}
7373

74-
export interface CachedMatterAccessory { /* coming soon */ }
74+
export interface CachedMatterAccessory {
75+
plugin: string
76+
platform: string
77+
uuid: string
78+
displayName: string
79+
deviceType: {
80+
name: string
81+
}
82+
serialNumber: string
83+
manufacturer: string
84+
model: string
85+
clusters: Record<string, any>
86+
$deviceId: string
87+
$protocol: string
88+
}
7589

7690
export declare type PluginConfig = Record<string, any>
7791

src/ui.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ class HomebridgePluginUi extends EventTargetConstructor {
248248
}
249249

250250
public async getCachedMatterAccessories(): Promise<Record<string, any>[]> {
251-
return []
251+
return await this._requestResponse({ action: 'cachedMatterAccessories.get' })
252252
}
253253

254254
public async request(path: string, body?: any) {

0 commit comments

Comments
 (0)