@@ -81,6 +81,15 @@ export class HomebridgeEasyMQTT implements DynamicPlatformPlugin {
8181 const Characteristic = this . api . hap . Characteristic ;
8282 const HapStatusError = this . api . hap . HapStatusError ;
8383
84+ const getMatter = ( ) => {
85+
86+ if ( ! this . api . matter ) {
87+ throw new Error ( 'Matter API is not available — this plugin requires a Matter-enabled Homebridge bridge.' ) ; // TODO
88+ }
89+
90+ return this . api . matter ;
91+ } ;
92+
8493 const history = new History ( this . api , this . log ) ;
8594
8695 for ( const accessoryConfig of this . config . accessories ) {
@@ -104,7 +113,7 @@ export class HomebridgeEasyMQTT implements DynamicPlatformPlugin {
104113 const uuid = this . api . hap . uuid . generate ( id ) ;
105114
106115 const platformAccessory = this . createPlatformAccessory ( accessoryConfig . info . name , uuid ) ;
107- const dependency : AccessoryDependency = { Service, Characteristic, HapStatusError, platformAccessory, log : this . log , history : history } ;
116+ const dependency : AccessoryDependency = { Service, Characteristic, HapStatusError, getMatter , platformAccessory, log : this . log , history : history } ;
108117
109118 const accessory = createAccessory ( dependency , accessoryConfig ) ;
110119
@@ -120,7 +129,7 @@ export class HomebridgeEasyMQTT implements DynamicPlatformPlugin {
120129
121130 const uuid = this . api . hap . uuid . generate ( groupName ) ;
122131 const platformAccessory = this . createPlatformAccessory ( groupName , uuid ) ;
123- const dependency : AccessoryDependency = { Service, Characteristic, HapStatusError, platformAccessory, log : this . log , history : history } ;
132+ const dependency : AccessoryDependency = { Service, Characteristic, HapStatusError, getMatter , platformAccessory, log : this . log , history : history } ;
124133
125134 const configs = groups . get ( groupName ) ! ;
126135
0 commit comments