import { PlugIn } from '../interfaces/plugin' ; export class DeviceMove implements PlugIn { private devices = { } ; private deviceConfigurations = { } ; private deviceConfigurationCallbacks = { } ; public usage : string = "This is a sample plugin that implements IDeviceMove" ; public initialize = ( ) => { return undefined ; } ; public reset = ( ) => { return undefined ; } ; public configureDevice = ( deviceId , running , configuration , cb ) => { if ( ! running ) { this . devices [ deviceId ] = { } ; } this . deviceConfigurations [ configuration . deviceId ] = configuration ; this . deviceConfigurationCallbacks [ configuration . deviceId ] = cb ; } ; public postConnect = ( deviceId ) => { return undefined ; } ; public stopDevice = ( deviceId ) => { return undefined ; } ; public propertyResponse = ( deviceId , capability , payload ) => { return undefined ; } ; public commandResponse = ( deviceId , capability , payload ) => { if ( capability . name === 'DeviceMove' ) { this . deviceConfigurations [ deviceId ] . scopeId = payload ; this . deviceConfigurationCallbacks [ deviceId ] ( this . deviceConfigurations [ deviceId ] ) ; return true ; } return undefined ; } ; public desiredResponse = ( deviceId , capability ) => { return undefined ; } ; }