import { Device } from "./device" ; import { IDeviceInterface } from "../interfaces" ; import * as Consts from "../consts" ; class extends Device export class RemoteControlButton extends Device { constructor ( hub , portId ) { super ( hub , portId , ModeMap , Consts . DeviceType . REMOTE_CONTROL_BUTTON ) ; } public receive ( message ) { const mode = this . _mode ; switch ( mode ) { case Mode . BUTTON_EVENTS : event type { object } param { number } event const event = message [ 4 ] ; this . notify ( "remoteButton" , { event } ) ; break ; } } } export enum Mode { BUTTON_EVENTS = 0x00 } export const ModeMap = { "remoteButton" : Mode . BUTTON_EVENTS } ; export const ButtonState = { "UP" : 0x01 , "DOWN" : 0xff , "STOP" : 0x7f , "RELEASED" : 0x00 , } ;