import { PlugIn } from '../interfaces/plugin' ; export class Increment implements PlugIn { private devices = { } ; public usage : string = "This is a sample plugin that will provide an integer that increments by 1 on every loop or manual send. Acts on the device for all capabilities" ; public initialize = ( ) => { return undefined ; } ; public reset = ( ) => { return undefined ; } ; public configureDevice = ( deviceId , running ) => { if ( ! running ) { this . devices [ deviceId ] = { } ; } } ; public postConnect = ( deviceId ) => { return undefined ; } ; public stopDevice = ( deviceId ) => { return undefined ; } ; public propertyResponse = ( deviceId , capability , payload ) => { if ( Object . getOwnPropertyNames ( this . devices [ deviceId ] ) . indexOf ( capability . _id ) > - 1 ) { this . devices [ deviceId ] [ capability . _id ] = this . devices [ deviceId ] [ capability . _id ] + 1 ; } else { this . devices [ deviceId ] [ capability . _id ] = 0 ; } return this . devices [ deviceId ] [ capability . _id ] ; } ; public commandResponse = ( deviceId , capability ) => { return undefined ; } ; public desiredResponse = ( deviceId , capability ) => { return undefined ; } ; }