import { HomebridgeMagichomeDynamicPlatformAccessory } from '../platformAccessory' ; export class DimmerStrip extends HomebridgeMagichomeDynamicPlatformAccessory { /**
     ** @updateHomekitState
     * send state to homekit
     */ async updateHomekitState ( ) { this . lightState . brightness = this . lightState . RGB . red / 2.55 ; this . service . updateCharacteristic ( this . platform . Characteristic . On , this . lightState . isOn ) ; if ( this . lightState . isOn ) { this . service . updateCharacteristic ( this . platform . Characteristic . Brightness , this . lightState . brightness ) ; } } async setColor ( ) { const brightness = Math . round ( ( 2.55 * this . lightState . brightness ) ) ; await this . send ( [ 0x31 , brightness , 0x00 , 0x00 , 0x03 , 0x01 , 0x0F ] ) ; } }