import { Service , Characteristic , CharacteristicEventTypes } from 'homebridge' ; export function add ( maybeDevice , service , characteristic ) { maybeDevice . then ( ( device ) => { device . on ( 'filterLifeChanged' , ( value ) => { service . updateCharacteristic ( characteristic , value ) ; } ) ; } ) ; return service . getCharacteristic ( characteristic ) . onGet ( async ( ) => { const device = await maybeDevice ; return await device . filterLifeLevel ( ) ; } ) ; }