import { Device } from "./device" ; import { IDeviceInterface } from "../interfaces" ; import * as Consts from "../consts" ; class extends Device export class MarioPantsSensor extends Device { constructor ( hub , portId ) { super ( hub , portId , ModeMap , Consts . DeviceType . MARIO_PANTS_SENSOR ) ; } public receive ( message ) { const mode = this . _mode ; switch ( mode ) { case Mode . PANTS : event type { object } param { number } pants const pants = message [ 4 ] ; this . notify ( "pants" , { pants } ) ; break ; } } } export enum Mode { PANTS = 0x00 } export const ModeMap = { "pants" : Mode . PANTS , } ;