hap-fluent / FluentAccessory
Type Alias: FluentAccessory<TContext, Services>
ts
type FluentAccessory<TContext, Services> = ServicesObject<Services> & PlatformAccessory<TContext>;Defined in: packages/hap-fluent/src/AccessoryHandler.ts:279
A Homebridge PlatformAccessory augmented with strongly-typed FluentService properties for each declared service.
Type Parameters
| Type Parameter | Description |
|---|---|
TContext extends UnknownContext | The accessory's custom context type (extends UnknownContext). |
Services extends Interfaces[] | Tuple of HAP interface types declared for this accessory. |
Remarks
FluentAccessory is the return type of initializeAccessory. It is the same object as the input PlatformAccessory (mutated in place via Object.assign) so it can be passed directly to api.registerPlatformAccessories() or api.updatePlatformAccessories().
Access services via camelCase property names:
accessory.lightbulb→FluentService<typeof Service.Lightbulb>accessory.accessoryInformation→FluentService<typeof Service.AccessoryInformation>