Rev 2131 | Rev 2210 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 2131 | Rev 2132 | ||
|---|---|---|---|
| Line 140... | Line 140... | ||
| 140 | "Status" : "Burst" }; |
140 | "Status" : "Burst" }; |
| 141 | 141 | ||
| 142 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "IR", variables)) |
142 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "IR", variables)) |
| 143 | { |
143 | { |
| 144 | Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
144 | Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
| - | 145 | ||
| - | 146 | var last_value = {}; |
|
| - | 147 | var last_value_string = Storage_GetParameter("LastValues", name); |
|
| - | 148 | ||
| - | 149 | if (last_value_string) |
|
| - | 150 | { |
|
| - | 151 | last_value = eval("(" + last_value_string + ")"); |
|
| - | 152 | } |
|
| - | 153 | ||
| - | 154 | last_value["Level"] = { "value" : level, "timestamp" : get_time() }; |
|
| - | 155 | ||
| - | 156 | Storage_SetParameter("LastValues", name, JSON.stringify(last_value)); |
|
| 145 | } |
157 | } |
| 146 | else |
158 | else |
| 147 | { |
159 | { |
| 148 | Log("\033[31mFailed to send command to " + name + ".\033[0m\n"); |
160 | Log("\033[31mFailed to send command to " + name + ".\033[0m\n"); |
| 149 | } |
161 | } |