Options
All
  • Public
  • Public/Protected
  • All
Menu

Devices are a semantic and the recommended way of organizing Actions and DynamicValues. They represent an external device and hold all of the actions and values associated with it.

example

const device = new Device({
      name:"test",
      actions:[
          new HttpAction({
              name:"on",
              method:"GET",
              base:"http://device.ip/",
              path:"turnOn"
          })
      ]
})
device.run("on") //runs the HttpAction
device.getAction("on") //returns HttpAction {name:"on", method:"GET",base:"http://device.ip/",path:"turnOn",url:"http://device.ip/turnOn"}

Hierarchy

  • Device

Implements

Constructors

constructor

  • new Device(__namedParameters: object): Device

Parameters

  • __namedParameters: object

Returns Device

Properties

actions

actions: Action[]

dynamicValues

dynamicValues: DynamicValue<unknown>[]

name

name: string

Methods

getAction

  • getAction(name: string): Action

Parameters

  • name: string

Returns Action

getDynamicValue

Type parameters

  • T

Parameters

  • name: string

Returns DynamicValue<T>

run

Parameters

  • action: string

Returns Promise<ActionSuccess>

  • Inherited
  • Protected
  • Private
  • Static
  • Module
  • Object
  • Property
  • Function
  • Variable
  • Index
  • Type
  • Class
  • Interface
  • Enum
  • Constructor
  • Getter/Setter
Made with ❤️ by pirix-gh. Documentation generated by TypeDoc.