Skip to content

Commit 53570c1

Browse files
committed
add empty method for future homebridge version
1 parent 620b02a commit 53570c1

5 files changed

Lines changed: 18 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ All notable changes to `@homebridge/plugin-ui-utils` will be documented in this
88

99
- updated dependencies
1010
- update release script for oidc releases
11+
- add empty method for future homebridge version
1112

1213
## v2.1.2 (2025-11-22)
1314

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ const schema = await homebridge.getPluginConfigSchema()
180180

181181
> `homebridge.getCachedAccessories(): Promise<CachedAccessory[]>;`
182182
183-
Returns the cached accessories for the plugin
183+
Returns the cached accessories for the plugin.
184184

185185
```ts
186186
const cachedAccessories = await homebridge.getCachedAccessories()

src/ui.interface.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ export interface CachedAccessory {
7171
services: any[]
7272
}
7373

74+
export interface CachedMatterAccessory { /* coming soon */ }
75+
7476
export declare type PluginConfig = Record<string, any>
7577

7678
export declare class IHomebridgePluginUi extends EventTarget {
@@ -267,6 +269,11 @@ export declare class IHomebridgePluginUi extends EventTarget {
267269
*/
268270
public getCachedAccessories(): Promise<CachedAccessory[]>
269271

272+
/**
273+
* Return an array of cached Matter accessories for your plugin.
274+
*/
275+
public getCachedMatterAccessories(): Promise<CachedMatterAccessory[]>
276+
270277
/**
271278
* Make a request to the plugins server side script
272279
* @param path - the path handler on the server that the request should be sent to

src/ui.mock.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ export class MockHomebridgePluginUi extends EventTarget implements IHomebridgePl
111111
public async getCachedAccessories() {
112112
return []
113113
}
114+
115+
public async getCachedMatterAccessories() {
116+
return []
117+
}
114118
}
115119

116120
export class MockHomebridgeUiToastHelper implements IHomebridgeUiToastHelper {

src/ui.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,14 @@ class HomebridgePluginUi extends EventTargetConstructor {
243243
return await this._requestResponse({ action: 'config.schema' })
244244
}
245245

246-
public async getCachedAccessories(): Promise<Record<string, string>> {
246+
public async getCachedAccessories(): Promise<Record<string, any>[]> {
247247
return await this._requestResponse({ action: 'cachedAccessories.get' })
248248
}
249249

250+
public async getCachedMatterAccessories(): Promise<Record<string, any>[]> {
251+
return []
252+
}
253+
250254
public async request(path: string, body?: any) {
251255
return await this._requestResponse({ action: 'request', path, body })
252256
}

0 commit comments

Comments
 (0)