mirror of
https://github.com/pyrou/X10RF-Arduino.git
synced 2026-07-28 04:06:11 +00:00
add BRIGHT/DIM commands support
This commit is contained in:
@@ -16,3 +16,12 @@ RFXmeter KEYWORD2
|
||||
RFXsensor KEYWORD2
|
||||
x10Switch KEYWORD2
|
||||
x10Security KEYWORD2
|
||||
|
||||
#######################################
|
||||
# Constants (LITERAL1)
|
||||
#######################################
|
||||
|
||||
ON LITERAL1
|
||||
OFF LITERAL1
|
||||
BRIGHT LITERAL1
|
||||
DIM LITERAL1
|
||||
|
||||
@@ -178,8 +178,11 @@ void x10rf::x10Switch(char house_code, uint8_t unit_code, uint8_t command){
|
||||
x10buff[0] = x10buff[0] << 4; // House code goes into the upper nibble
|
||||
|
||||
switch(command) {
|
||||
case 0: x10buff[2] = (x10buff[2] | 0x20); break;
|
||||
case 1: x10buff[2] = (x10buff[2] & 0x20); break;
|
||||
case ON:
|
||||
case OFF:
|
||||
case BRIGHT:
|
||||
case DIM:
|
||||
x10buff[2] = command; break;
|
||||
}
|
||||
// Set unit number
|
||||
unit_code = unit_code - 1;
|
||||
|
||||
Reference in New Issue
Block a user