mirror of https://github.com/arendst/Tasmota.git
[Shutter] Fix UI inverted mode (#22538)
Fix UI for shutter in inverted mode
This commit is contained in:
parent
f255233f90
commit
3c703ac4d4
|
@ -1424,6 +1424,7 @@ void HandleRoot(void) {
|
||||||
|
|
||||||
int32_t ShutterWebButton;
|
int32_t ShutterWebButton;
|
||||||
uint32_t shutter_button_idx = 1;
|
uint32_t shutter_button_idx = 1;
|
||||||
|
uint32_t shutter_button_idx_temp;
|
||||||
for (uint32_t shutter_idx = 0; shutter_idx < TasmotaGlobal.shutters_present ; shutter_idx++) {
|
for (uint32_t shutter_idx = 0; shutter_idx < TasmotaGlobal.shutters_present ; shutter_idx++) {
|
||||||
while ((0 == shutter_button & (1 << (shutter_button_idx -1)))) { shutter_button_idx++; }
|
while ((0 == shutter_button & (1 << (shutter_button_idx -1)))) { shutter_button_idx++; }
|
||||||
|
|
||||||
|
@ -1431,9 +1432,11 @@ void HandleRoot(void) {
|
||||||
shutter_button_idx++; // Left button is next button first (down)
|
shutter_button_idx++; // Left button is next button first (down)
|
||||||
for (uint32_t j = 0; j < 2; j++) {
|
for (uint32_t j = 0; j < 2; j++) {
|
||||||
ShutterWebButton = IsShutterWebButton(shutter_button_idx);
|
ShutterWebButton = IsShutterWebButton(shutter_button_idx);
|
||||||
WSContentSend_P(HTTP_DEVICE_CONTROL, 15, shutter_button_idx, shutter_button_idx,
|
shutter_button_idx_temp = ShutterGetOptions(abs(ShutterWebButton)-1) & 1 /* invert index */ ? shutter_button_idx + (j * 2) - 1 : shutter_button_idx;
|
||||||
|
// AddLog(LOG_LEVEL_DEBUG, PSTR("SHT: j %d, ShutterWebButton %d, shutter_button_idx %d, shutter_idx %d, shutter_button_idx_temp %d"), j, ShutterWebButton, shutter_button_idx, shutter_idx, shutter_button_idx_temp);
|
||||||
|
WSContentSend_P(HTTP_DEVICE_CONTROL, 15, shutter_button_idx_temp, shutter_button_idx_temp,
|
||||||
((ShutterGetOptions(abs(ShutterWebButton)-1) & 2) /* is locked */ ? "-" :
|
((ShutterGetOptions(abs(ShutterWebButton)-1) & 2) /* is locked */ ? "-" :
|
||||||
((ShutterGetOptions(abs(ShutterWebButton)-1) & 8) /* invert web buttons */ ? ((ShutterWebButton>0) ? "▼" : "▲") : ((ShutterWebButton>0) ? "▲" : "▼"))),
|
((ShutterGetOptions(abs(ShutterWebButton)-1) & 1) /* invert web buttons */ ? (j ? "▼" : "▲") : (j ? "▲" : "▼"))),
|
||||||
"");
|
"");
|
||||||
|
|
||||||
if (1 == j) { break; }
|
if (1 == j) { break; }
|
||||||
|
|
Loading…
Reference in New Issue