mirror of
https://github.com/anklimov/lighthub
synced 2025-12-06 11:49:51 +03:00
items: /sat and /hue parameters can be changed separately
This commit is contained in:
@@ -62,9 +62,9 @@ e-mail anklimov@gmail.com
|
||||
|
||||
|
||||
#define T_LONG 1000
|
||||
#define T_IDLE 600
|
||||
#define T_IDLE 700
|
||||
#define T_RPT 300
|
||||
#define T_RPT_PULSE 200
|
||||
#define T_RPT_PULSE 150
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -551,6 +551,7 @@ int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int suffixCode
|
||||
break;
|
||||
case CMD_DN:
|
||||
case CMD_UP:
|
||||
{
|
||||
if (itemType == CH_GROUP) break;
|
||||
if (!n || !Par[0]) Par[0] = DEFAULT_INC_STEP;
|
||||
if (cmd == CMD_DN) Par[0]=-Par[0];
|
||||
@@ -596,7 +597,7 @@ int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int suffixCode
|
||||
|
||||
modified = true;
|
||||
break;
|
||||
}
|
||||
} //switch suffix
|
||||
|
||||
if (modified)
|
||||
{
|
||||
@@ -611,9 +612,27 @@ int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int suffixCode
|
||||
cmd=CMD_NUM;
|
||||
suffixCode=S_SET;
|
||||
debugSerial<<"to: h="<<Par[0]<<" s="<<Par[1] <<" v="<<Par[2]<<endl;
|
||||
}
|
||||
}
|
||||
} // if modified
|
||||
} //RGBx channel
|
||||
}
|
||||
break;
|
||||
case CMD_NUM:
|
||||
if (itemType == CH_GROUP || n!=1) break;
|
||||
st.aslong = getVal();
|
||||
switch (suffixCode)
|
||||
{
|
||||
case S_SAT:
|
||||
Par[1] = Par[0];
|
||||
Par[0] = st.h;
|
||||
Par[2] = st.v;
|
||||
n=3;
|
||||
break;
|
||||
|
||||
case S_HUE:
|
||||
Par[1] = st.s;
|
||||
Par[2] = st.v;
|
||||
n=3;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user