ReadonlyhapReadonlyhapCheck if HAP is enabled for this bridge (bridge.hap or _bridge.hap).
Enabled by default, and still true in externalsOnly mode, where the bridge
accessory is not published but external HAP accessories still are - the same
meaning as isMatterEnabled. False only when HAP is disabled outright.
Use isHapExternalsOnly to tell whether bridged accessories will show.
true if HAP is in use on this bridge
Check if this bridge is in HAP externalsOnly mode: the bridge accessory, and so every bridged accessory, is not published, while external accessories are.
true if only external HAP accessories publish from this bridge
Check 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
Check if this bridge is in Matter externalsOnly mode: the bridge node, and so every bridged accessory, is not published, while external accessories are. Only ever true when isMatterEnabled is.
true if only external Matter accessories publish from this bridge
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