@@ -170,50 +170,74 @@ class PluginUpdatePlatform implements DynamicPlatformPlugin {
170
170
171
171
let logLevel = ( this . firstDailyRun === true ) ? LogLevel . INFO : LogLevel . DEBUG
172
172
const updatesAvailable : InstalledPlugin [ ] = [ ]
173
+
174
+ // Get ignored plugins from API if respectDisabledPlugins is enabled
175
+ let ignoredPlugins : string [ ] = [ ]
176
+ if ( this . respectDisabledPlugins ) {
177
+ try {
178
+ ignoredPlugins = await this . uiApi . getIgnoredPlugins ( )
179
+ this . log . debug ( `Retrieved ${ ignoredPlugins . length } ignored plugin(s) from homebridge-config-ui-x: ${ ignoredPlugins . join ( ', ' ) } ` )
180
+ } catch ( error ) {
181
+ this . log . warn ( `Failed to retrieve ignored plugins list, filtering disabled: ${ error } ` )
182
+ ignoredPlugins = [ ]
183
+ }
184
+ } else {
185
+ this . log . debug ( 'respectDisabledPlugins is disabled, skipping plugin filtering' )
186
+ }
173
187
174
188
if ( this . checkHB ) {
175
189
const homebridge = await this . uiApi . getHomebridge ( )
176
190
177
191
if ( homebridge . updateAvailable ) {
178
- updatesAvailable . push ( homebridge )
192
+ // Check if homebridge core updates are ignored
193
+ const isIgnored = this . respectDisabledPlugins && ignoredPlugins . includes ( 'homebridge' )
194
+
195
+ if ( ! isIgnored ) {
196
+ updatesAvailable . push ( homebridge )
179
197
180
- const version : string = homebridge . latestVersion
198
+ const version : string = homebridge . latestVersion
181
199
182
- if ( this . hbUpdates . length === 0 || ! this . hbUpdates . includes ( version ) ) logLevel = LogLevel . INFO
183
- this . log . log ( logLevel , `Homebridge update available: ${ version } ` )
200
+ if ( this . hbUpdates . length === 0 || ! this . hbUpdates . includes ( version ) ) logLevel = LogLevel . INFO
201
+ this . log . log ( logLevel , `Homebridge update available: ${ version } ` )
184
202
185
- this . hbUpdates = [ version ]
203
+ this . hbUpdates = [ version ]
204
+ } else {
205
+ this . log . debug ( `Ignoring Homebridge core update: ${ homebridge . latestVersion } (update notifications disabled in homebridge-config-ui-x)` )
206
+ }
186
207
}
187
208
}
188
209
189
210
if ( this . checkHBUI || this . checkPlugins ) {
190
211
const plugins = await this . uiApi . getPlugins ( )
191
- let ignoredPlugins : string [ ] = [ ]
192
-
193
- // Get ignored plugins from API if respectDisabledPlugins is enabled
194
- if ( this . respectDisabledPlugins ) {
195
- ignoredPlugins = await this . uiApi . getIgnoredPlugins ( )
196
- }
197
212
198
213
if ( this . checkHBUI ) {
199
214
const homebridgeUiPlugins = plugins . filter ( plugin => plugin . name === 'homebridge-config-ui-x' )
200
215
201
216
// Only one plugin is returned
202
217
homebridgeUiPlugins . forEach ( ( homebridgeUI ) => {
203
218
if ( homebridgeUI . updateAvailable ) {
204
- updatesAvailable . push ( homebridgeUI )
219
+ // Check if homebridge-config-ui-x updates are ignored
220
+ const isIgnored = this . respectDisabledPlugins && ignoredPlugins . includes ( 'homebridge-config-ui-x' )
221
+
222
+ if ( ! isIgnored ) {
223
+ updatesAvailable . push ( homebridgeUI )
205
224
206
- const version : string = homebridgeUI . latestVersion
225
+ const version : string = homebridgeUI . latestVersion
207
226
208
- if ( this . hbUIUpdates . length === 0 || ! this . hbUIUpdates . includes ( version ) ) logLevel = LogLevel . INFO
209
- this . log . log ( logLevel , `Homebridge UI update available: ${ version } ` )
227
+ if ( this . hbUIUpdates . length === 0 || ! this . hbUIUpdates . includes ( version ) ) logLevel = LogLevel . INFO
228
+ this . log . log ( logLevel , `Homebridge UI update available: ${ version } ` )
210
229
211
- this . hbUIUpdates = [ version ]
230
+ this . hbUIUpdates = [ version ]
231
+ } else {
232
+ this . log . debug ( `Ignoring Homebridge UI update: ${ homebridgeUI . latestVersion } (update notifications disabled in homebridge-config-ui-x)` )
233
+ }
212
234
}
213
235
} )
214
236
}
215
237
216
238
if ( this . checkPlugins ) {
239
+ this . log . debug ( `Checking ${ plugins . length } plugins for updates (respectDisabledPlugins: ${ this . respectDisabledPlugins } )` )
240
+
217
241
const filteredPlugins = plugins . filter ( plugin => {
218
242
// Always exclude homebridge-config-ui-x
219
243
if ( plugin . name === 'homebridge-config-ui-x' ) {
@@ -223,13 +247,16 @@ class PluginUpdatePlatform implements DynamicPlatformPlugin {
223
247
// If respectDisabledPlugins is enabled, check API ignored list
224
248
if ( this . respectDisabledPlugins ) {
225
249
if ( ignoredPlugins . includes ( plugin . name ) ) {
250
+ this . log . debug ( `Filtering out plugin ${ plugin . name } (ignored in homebridge-config-ui-x)` )
226
251
return false
227
252
}
228
253
}
229
254
230
255
return true
231
256
} )
232
257
258
+ this . log . debug ( `After filtering: ${ filteredPlugins . length } plugins to check for updates` )
259
+
233
260
filteredPlugins . forEach ( ( plugin ) => {
234
261
if ( plugin . updateAvailable ) {
235
262
updatesAvailable . push ( plugin )
@@ -251,7 +278,7 @@ class PluginUpdatePlatform implements DynamicPlatformPlugin {
251
278
ignoredPlugins . includes ( plugin . name )
252
279
)
253
280
if ( ignoredWithUpdates . length > 0 ) {
254
- this . log . debug ( `Ignoring updates for ${ ignoredWithUpdates . length } plugin(s): ${ ignoredWithUpdates . map ( p => p . name ) . join ( ', ' ) } ` )
281
+ this . log . info ( `Ignoring updates for ${ ignoredWithUpdates . length } plugin(s): ${ ignoredWithUpdates . map ( p => p . name ) . join ( ', ' ) } ` )
255
282
}
256
283
}
257
284
}
@@ -273,6 +300,15 @@ class PluginUpdatePlatform implements DynamicPlatformPlugin {
273
300
}
274
301
275
302
this . log . log ( logLevel , `Found ${ updatesAvailable . length } available update(s)` )
303
+
304
+ // Provide additional diagnostic information in debug mode
305
+ if ( this . respectDisabledPlugins && ignoredPlugins . length > 0 ) {
306
+ this . log . debug ( `Filtering enabled with ${ ignoredPlugins . length } ignored plugins: ${ ignoredPlugins . join ( ', ' ) } ` )
307
+ } else if ( this . respectDisabledPlugins ) {
308
+ this . log . debug ( 'Filtering enabled but no ignored plugins found' )
309
+ } else {
310
+ this . log . debug ( 'Plugin filtering is disabled (respectDisabledPlugins: false)' )
311
+ }
276
312
277
313
return updatesAvailable . length
278
314
}
0 commit comments