Subversion Repositories HomeAutomation

Rev

Rev 1610 | Rev 1626 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | SVN | RSS feed

Rev Author Line No. Line
1603 runge 1
 
2
function Dimmer230(name)
3
{
4
    this.Module(name);
1609 runge 5
    Dimmer230.instance_ = this;
1603 runge 6
}
7
 
8
Extend(Dimmer230, Module);
9
 
1609 runge 10
Dimmer230.instance_ = null;
11
 
1603 runge 12
Dimmer230.prototype.ReceiveMessage = function(id, command, variables)
13
{
14
    switch (command)
15
    {
16
        case "Netinfo":
17
        {
18
            break;
19
        }
20
    }
21
 
22
    this.Module.prototype.ReceiveMessage.call(this, id, command, variables);
23
}
24
 
1610 runge 25
function Dimmer230_StartFade(id, channel, speed, direction)
1609 runge 26
{
1603 runge 27
    var variables = [
28
    { "Channel"   : channel },
29
    { "Speed"     : speed },
30
    { "Direction" : direction } ];
31
 
1609 runge 32
    Dimmer230.instance_.Module.prototype.SendMessage.call(Dimmer230.instance_, id, "Start_Fade", variables);
33
    return "OK";
1603 runge 34
}
1614 runge 35
RegisterConsoleCommand(Dimmer230_StartFade, function(args) { return StandardAutocomplete(args, Dimmer230.instance_.GetAvailableIds(), [ 0 ], [ 50, 135, 200, 255 ], [ "Increase", "Decrease" ]); });
1603 runge 36
 
1609 runge 37
 
1610 runge 38
function Dimmer230_StopFade(id, channel)
1603 runge 39
{
40
    var variables = [
41
    { "Channel"  : channel } ];
42
 
1609 runge 43
    Dimmer230.instance_.Module.prototype.SendMessage.call(Dimmer230.instance_, id, "Stop_Fade", variables);
44
    return "OK";
1603 runge 45
}
1614 runge 46
RegisterConsoleCommand(Dimmer230_StopFade, function(args) { return StandardAutocomplete(args, Dimmer230.instance_.GetAvailableIds(), [ 0 ]); });
1603 runge 47
 
1609 runge 48
 
1610 runge 49
function Dimmer230_AbsoluteFade(id, channel, speed, end_value)
1603 runge 50
{
51
    var variables = [
52
    { "Channel"  : channel },
53
    { "Speed"    : speed },
54
    { "EndValue" : end_value } ];
55
 
1609 runge 56
    Dimmer230.instance_.Module.prototype.SendMessage.call(Dimmer230.instance_, id, "Abs_Fade", variables);
57
    return "OK";
1603 runge 58
}
1614 runge 59
RegisterConsoleCommand(Dimmer230_AbsoluteFade, function(args) { return StandardAutocomplete(args, Dimmer230.instance_.GetAvailableIds(), [ 0 ], [ 50, 135, 200, 255 ], [ 0, 50, 100, 150, 200, 255 ]); });
1603 runge 60
 
1609 runge 61
 
1610 runge 62
function Dimmer230_RelativeFade(id, channel, speed, direction, steps)
1603 runge 63
{
64
    var variables = [
65
    { "Channel"   : channel },
66
    { "Speed"     : speed },
67
    { "Direction" : direction },
68
    { "Steps"     : steps } ];
69
 
1609 runge 70
    Dimmer230.instance_.Module.prototype.SendMessage.call(Dimmer230.instance_, id, "Rel_Fade", variables);
71
    return "OK";
1603 runge 72
}
1614 runge 73
RegisterConsoleCommand(Dimmer230_RelativeFade, function(args) { return StandardAutocomplete(args, Dimmer230.instance_.GetAvailableIds(), [ 0 ], [ 50, 135, 200, 255 ], [ "Increase", "Decrease" ], [ 0, 10, 20, 30, 40, 50, 60, 70, 80, 90 ]); });
1603 runge 74
 
1609 runge 75
 
1610 runge 76
function Dimmer230_Demo(id, channel, speed, steps)
1603 runge 77
{
78
    var variables = [
79
    { "Channel"   : channel },
80
    { "Speed"     : speed },
81
    { "Steps"     : steps } ];
82
 
1609 runge 83
    Dimmer230.instance_.Module.prototype.SendMessage.call(Dimmer230.instance_, id, "Demo", variables);
84
    return "OK";
1603 runge 85
}
1614 runge 86
RegisterConsoleCommand(Dimmer230_Demo, function(args) { return StandardAutocomplete(args, Dimmer230.instance_.GetAvailableIds(), [ 0 ], [ 50, 135, 200, 255 ], [ 0, 10, 20, 30, 40, 50, 60, 70, 80, 90 ]); });