Difference between revisions of "Insteon PLM Ruby Code 756"
From LinuxMCE
Line 1: | Line 1: | ||
− | <pre> | + | <pre>#### Written by Dan Damron |
− | #### Written by Dan Damron | + | |
#### #756 Report Child Devices #### | #### #756 Report Child Devices #### | ||
Line 10: | Line 9: | ||
#with params_: | #with params_: | ||
#12 Error Message (string) | #12 Error Message (string) | ||
− | # if this is not empty, that means an error occurred. | + | # if this is not empty, that means an error occurred. |
# | # | ||
#13 Text (string) | #13 Text (string) | ||
− | # a list like this: | + | # a list like this: |
− | # [internal id] \t | + | # [internal id] \t |
− | # [description] \t | + | # [description] \t |
− | # [room name] \t | + | # [room name] \t |
− | # [device template] \t | + | # [device template] \t |
− | # [floorplan id] \n | + | # [floorplan id] \n |
Line 25: | Line 24: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
@work = "" | @work = "" | ||
$childdatabases.each_key{|insteonID| | $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" | ||
− | |||
− | |||
} | } |
Revision as of 00:13, 12 March 2008
#### 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)