mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-25 23:37:16 +00:00
Merge pull request #7361 from s-hadinger/white_more_fixes
More White fixes
This commit is contained in:
commit
0c9c41b10f
@ -1416,15 +1416,17 @@ void LightState(uint8_t append)
|
|||||||
|
|
||||||
if (Light.subtype > LST_SINGLE) {
|
if (Light.subtype > LST_SINGLE) {
|
||||||
ResponseAppend_P(PSTR(",\"" D_CMND_COLOR "\":\"%s\""), LightGetColor(scolor));
|
ResponseAppend_P(PSTR(",\"" D_CMND_COLOR "\":\"%s\""), LightGetColor(scolor));
|
||||||
uint16_t hue;
|
if (LST_RGB <= Light.subtype) {
|
||||||
uint8_t sat, bri;
|
uint16_t hue;
|
||||||
light_state.getHSB(&hue, &sat, &bri);
|
uint8_t sat, bri;
|
||||||
sat = changeUIntScale(sat, 0, 255, 0, 100);
|
light_state.getHSB(&hue, &sat, &bri);
|
||||||
bri = changeUIntScale(bri, 0, 255, 0, 100);
|
sat = changeUIntScale(sat, 0, 255, 0, 100);
|
||||||
|
bri = changeUIntScale(bri, 0, 255, 0, 100);
|
||||||
|
|
||||||
ResponseAppend_P(PSTR(",\"" D_CMND_HSBCOLOR "\":\"%d,%d,%d\""), hue,sat,bri);
|
ResponseAppend_P(PSTR(",\"" D_CMND_HSBCOLOR "\":\"%d,%d,%d\""), hue,sat,bri);
|
||||||
|
}
|
||||||
// Add White level
|
// Add White level
|
||||||
if (LST_RGBW <= Light.subtype) {
|
if ((LST_COLDWARM == Light.subtype) || (LST_RGBW <= Light.subtype)) {
|
||||||
ResponseAppend_P(PSTR(",\"" D_CMND_WHITE "\":%d"), light_state.getDimmer(2));
|
ResponseAppend_P(PSTR(",\"" D_CMND_WHITE "\":%d"), light_state.getDimmer(2));
|
||||||
}
|
}
|
||||||
// Add CT
|
// Add CT
|
||||||
@ -2095,10 +2097,12 @@ void CmndColor(void)
|
|||||||
void CmndWhite(void)
|
void CmndWhite(void)
|
||||||
{
|
{
|
||||||
if (Light.pwm_multi_channels) { return; }
|
if (Light.pwm_multi_channels) { return; }
|
||||||
if ((Light.subtype >= LST_RGBW) && (XdrvMailbox.index == 1)) {
|
if ( ((Light.subtype >= LST_RGBW) || (LST_COLDWARM == Light.subtype)) && (XdrvMailbox.index == 1)) {
|
||||||
if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 100)) {
|
if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 100)) {
|
||||||
light_controller.changeDimmer(XdrvMailbox.payload, 2);
|
light_controller.changeDimmer(XdrvMailbox.payload, 2);
|
||||||
LightPreparePower(2);
|
LightPreparePower(2);
|
||||||
|
} else {
|
||||||
|
ResponseCmndNumber(light_state.getDimmer(2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user