Skip to content

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 ParameterDescription
TContext extends UnknownContextThe 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.lightbulbFluentService<typeof Service.Lightbulb>
  • accessory.accessoryInformationFluentService<typeof Service.AccessoryInformation>

Released under the Apache-2.0 License.