Class com.sekati.services.AmbientOrb

Description

Ambient Orb developer channel controller class

 Usage:
 var orb:AmbientOrb = new AmbientOrb("AAA-BBB-CCC");
 orb.config ( getColorByProp("name","red"), getAnimByProp("name","heartbeat"), "Orb Test" );
 

See Also

Field Index

anim, code, devId, spectrum

Method Index

new AmbientOrb()
config(), getAnimByProp(), getCodeByProp(), getColorByProp()

Constructor Detail

AmbientOrb

public function AmbientOrb(devId:String)

Constructor

Parameters

devId(String) - orb device id to be controlled by this instance

Return

Void

Field Detail

devId

public devId:String
devId getter

spectrum

public spectrum:Array [Read Only]
spectrum getter

anim

public anim:Array [Read Only]
anim getter

code

public code:Array [Read Only]
server code getter

Method Detail

getColorByProp

public function getColorByProp(prop:String, key:String):Object

locate a color object by one of its properties

Parameters

prop(String) - acceptable props: "id", "hex", "name"
key(String) - value to match by, e.g: "0xFF00FF"

Return

Object - the matched _SPECTRUM object

Throws

Erroron failed match

getAnimByProp

public function getAnimByProp(prop:String, key:String):Object

locate an animation by one of its properties

Parameters

prop(String) - acceptable props: "id", "name"
key(String) - value to match by, e.g: "slow"

Return

Object - the matched _ANIM object

Throws

Erroron failed match

getCodeByProp

public function getCodeByProp(prop:String, key:String):Object

locate a server code by one of its properties

Parameters

prop(String) - acceptable props: "id", "desc"
key(String) - value to match by, e.g: "Unspecific error"

Return

Object - the matched _CODE object

Throws

Erroron failed match

config

public function config(colorId:String, animId:String, comment:String):Void

send new configuration to the ambient orb device id

Parameters

colorId(String)
animId(String)
comment(String)

Return

Void

Throws

Errorif instance device id, colorId,animId params have not been set
 Usage:
 orb.config ( getColorByProp("name","red"), getAnimByProp("name","heartbeat"), "Orb Test" );