ReadonlyhapReadonlyhapCheck if Matter is available in this version of Homebridge
true if Homebridge version is >= 2.0.0-alpha.0
Check if Matter is enabled for this bridge
For main bridge: returns true if Matter is enabled in bridge.matter config
For child bridge: returns true if Matter is enabled in the _bridge.matter config
true if Matter is enabled
Optional ReadonlymatterMatter Protocol API.
Defined when Matter is configured for this bridge (i.e. when
api.isMatterEnabled() returns true), undefined otherwise. Loaded
automatically before plugins run on Matter-enabled bridges, so
plugins can access it from their initializer, platform/accessory
constructor, or didFinishLaunching handler.
Safe access patterns:
api.matter?.registerPlatformAccessories(...) // defensive, no-ops when disabled
if (api.isMatterEnabled()) {
api.matter!.registerPlatformAccessories(...) // explicit guard
}
// Register a Matter accessory
api.matter?.registerPlatformAccessories('homebridge-example', 'Example', [{
UUID: api.hap.uuid.generate('my-light'),
displayName: 'Living Room Light',
deviceType: api.matter!.deviceTypes.OnOffLight,
manufacturer: 'Example',
model: 'Example Light',
serialNumber: 'EX-001',
clusters: { onOff: { onOff: false } },
}])
// Update state
await api.matter?.updateAccessoryState(uuid, 'onOff', { onOff: true })
ReadonlyplatformReadonlyserverThe current homebridge semver version.
ReadonlyuserReadonlyversionThe homebridge API version as a floating point number.
Returns true if the current running homebridge version is greater or equal to the passed version string.
Example:
We assume the homebridge version 1.3.0-beta.12 (serverVersion) and the following example calls below
versionGreaterOrEqual("1.2.0"); // will return true
versionGreaterOrEqual("1.3.0"); // will return false (the RELEASE version 1.3.0 is bigger than the BETA version 1.3.0-beta.12)
versionGreaterOrEqual("1.3.0-beta.8); // will return true
Export types for basically everything but the actual API implementation