Insteon PLM Ruby Code 756

From LinuxMCE
Revision as of 04:03, 21 June 2008 by Langstonius (Talk | contribs)

Jump to: navigation, search
#### Written by Dan Damron
#### #756 Report Child Devices ####


#here is where I send all my newly discovered children..


#I need to fire an event [54]
#with params_:
#12 Error Message (string)
# if this is not empty, that means an error occurred.
#
#13 Text (string)
# a list like this:
# [internal id] \t
# [description] \t
# [room name] \t
# [device template] \t
# [floorplan id] \n


#First, Lets see if we actually 'get this command'
log($yellow+ '*#*#*#*#*#*#*#*# GOT #756 Report Child Devices! *#*#*#*#*#*#*#*#*'+ $grey)



@work = ""
$childdatabases.each_key{|insteonID|

# figure out what type of device to add here..
log('Child:' + insteonID)
log('Config:' + $childdatabases[insteonID].inspect)
@template = $devicetemplate[insteonID]

@work += insteonID + "\t\t\t" + @template.to_s + "\t\n"


}
log(@work)
cmd = Command.new(device_.devid_, -1000, 1, 2, 54)
cmd.params_[13] = @work
SendCommand(cmd)