mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 20:56:35 +00:00
Fix wrong Dimmer behavior introduced with #6799 when SetOption37 < 128
This commit is contained in:
parent
ba2439d9da
commit
bfcd156ee0
@ -2,6 +2,7 @@
|
|||||||
* 7.0.0.2 20191102
|
* 7.0.0.2 20191102
|
||||||
* Add command WebColor19 to control color of Module and Name (#6811)
|
* Add command WebColor19 to control color of Module and Name (#6811)
|
||||||
* Add support for Honeywell I2C HIH series Humidity and Temperetaure sensor (#6808)
|
* Add support for Honeywell I2C HIH series Humidity and Temperetaure sensor (#6808)
|
||||||
|
* Fix wrong Dimmer behavior introduced with #6799 when SetOption37 < 128
|
||||||
*
|
*
|
||||||
* 7.0.0.1 20191027
|
* 7.0.0.1 20191027
|
||||||
* Remove references to versions before 6.0
|
* Remove references to versions before 6.0
|
||||||
|
@ -2163,11 +2163,12 @@ void CmndColorTemperature(void)
|
|||||||
void CmndDimmer(void)
|
void CmndDimmer(void)
|
||||||
{
|
{
|
||||||
uint32_t dimmer;
|
uint32_t dimmer;
|
||||||
|
if (XdrvMailbox.index > 2) { XdrvMailbox.index = 1; }
|
||||||
if ((1 == XdrvMailbox.index) || (2 == XdrvMailbox.index)) { // Dimmer1 is RGB, Dimmer 2 iw white
|
|
||||||
dimmer = light_state.getDimmer(XdrvMailbox.index);
|
if ((light_controller.isCTRGBLinked()) || (0 == XdrvMailbox.index)) {
|
||||||
} else {
|
|
||||||
dimmer = light_state.getDimmer();
|
dimmer = light_state.getDimmer();
|
||||||
|
} else {
|
||||||
|
dimmer = light_state.getDimmer(XdrvMailbox.index);
|
||||||
}
|
}
|
||||||
// Handle +/- special command
|
// Handle +/- special command
|
||||||
if (1 == XdrvMailbox.data_len) {
|
if (1 == XdrvMailbox.data_len) {
|
||||||
@ -2179,10 +2180,17 @@ void CmndDimmer(void)
|
|||||||
}
|
}
|
||||||
// If value is ok, change it, otherwise report old value
|
// If value is ok, change it, otherwise report old value
|
||||||
if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 100)) {
|
if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 100)) {
|
||||||
if ((1 == XdrvMailbox.index) || (2 == XdrvMailbox.index)) {
|
if (light_controller.isCTRGBLinked()) {
|
||||||
light_controller.changeDimmer(XdrvMailbox.payload, XdrvMailbox.index);
|
// normal state, linked RGB and CW
|
||||||
} else {
|
|
||||||
light_controller.changeDimmer(XdrvMailbox.payload);
|
light_controller.changeDimmer(XdrvMailbox.payload);
|
||||||
|
} else {
|
||||||
|
if (0 != XdrvMailbox.index) {
|
||||||
|
light_controller.changeDimmer(XdrvMailbox.payload, XdrvMailbox.index);
|
||||||
|
} else {
|
||||||
|
// change both dimmers
|
||||||
|
light_controller.changeDimmer(XdrvMailbox.payload, 1);
|
||||||
|
light_controller.changeDimmer(XdrvMailbox.payload, 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Light.update = true;
|
Light.update = true;
|
||||||
LightPreparePower();
|
LightPreparePower();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user