Line | |
---|
1 | // Get Lids closed
|
---|
2 | function handleLidClosed(wait_state)
|
---|
3 | {
|
---|
4 | var state = dim.state("LID_CONTROL");
|
---|
5 | if (state===undefined)
|
---|
6 | return undefined;
|
---|
7 |
|
---|
8 | if (wait_state && wait_state.length>0 && state.name!=wait_state)
|
---|
9 | return wait_state;
|
---|
10 |
|
---|
11 | //dim.log("LID_CONTROL: "+state.name+"["+state.index+"]");
|
---|
12 |
|
---|
13 | switch (state.name)
|
---|
14 | {
|
---|
15 | // Do-nothing conditions
|
---|
16 | case "NoConnection":
|
---|
17 | case "Connected":
|
---|
18 | case "Unknown":
|
---|
19 | case "Moving":
|
---|
20 | return wait_state;
|
---|
21 |
|
---|
22 | case "Inconsistent":
|
---|
23 | case "Open":
|
---|
24 | console.out("Lid in "+state.name+"... closing lids.");
|
---|
25 | dim.send("LID_CONTROL/CLOSE");
|
---|
26 | return "Closed";
|
---|
27 |
|
---|
28 | case "Closed":
|
---|
29 | return "";
|
---|
30 | }
|
---|
31 |
|
---|
32 | throw new Error("LID_CONTROL:"+state.name+"["+state.index+"] unknown or not handled.");
|
---|
33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.