@@ -327,6 +327,7 @@ export interface BatteryArgs {
327
327
percentageReporting ?: boolean ;
328
328
voltageReportingConfig ?: ReportingConfigWithoutAttribute ;
329
329
voltageReporting ?: boolean ;
330
+ lowStatusReportingConfig ?: ReportingConfigWithoutAttribute ;
330
331
}
331
332
export function battery ( args ?: BatteryArgs ) : ModernExtend {
332
333
// biome-ignore lint/style/noParameterAssign: ignored using `--suppress`
@@ -433,18 +434,18 @@ export function battery(args?: BatteryArgs): ModernExtend {
433
434
} ,
434
435
] ;
435
436
436
- const result : ModernExtend = { exposes, fromZigbee, toZigbee, isModernExtend : true } ;
437
+ const result : ModernExtend = { exposes, fromZigbee, toZigbee, configure : [ ] , isModernExtend : true } ;
437
438
438
439
if ( args . percentageReporting || args . voltageReporting ) {
439
- const configure : Configure [ ] = [ ] ;
440
440
if ( args . percentageReporting ) {
441
- configure . push ( setupConfigureForReporting ( "genPowerCfg" , "batteryPercentageRemaining" , args . percentageReportingConfig , ea . STATE_GET ) ) ;
441
+ result . configure . push (
442
+ setupConfigureForReporting ( "genPowerCfg" , "batteryPercentageRemaining" , args . percentageReportingConfig , ea . STATE_GET ) ,
443
+ ) ;
442
444
}
443
445
if ( args . voltageReporting ) {
444
- configure . push ( setupConfigureForReporting ( "genPowerCfg" , "batteryVoltage" , args . voltageReportingConfig , ea . STATE_GET ) ) ;
446
+ result . configure . push ( setupConfigureForReporting ( "genPowerCfg" , "batteryVoltage" , args . voltageReportingConfig , ea . STATE_GET ) ) ;
445
447
}
446
- configure . push ( configureSetPowerSourceWhenUnknown ( "Battery" ) ) ;
447
- result . configure = configure ;
448
+ result . configure . push ( configureSetPowerSourceWhenUnknown ( "Battery" ) ) ;
448
449
}
449
450
450
451
if ( args . voltageToPercentage || args . dontDividePercentage ) {
@@ -454,6 +455,10 @@ export function battery(args?: BatteryArgs): ModernExtend {
454
455
result . meta = meta ;
455
456
}
456
457
458
+ if ( args . lowStatusReportingConfig ) {
459
+ result . configure . push ( setupConfigureForReporting ( "genPowerCfg" , "batteryAlarmState" , args . lowStatusReportingConfig , ea . STATE_GET ) ) ;
460
+ }
461
+
457
462
return result ;
458
463
}
459
464
0 commit comments