From 3d72ac8094b6f82f1097afe3ca8ca80ff8b98874 Mon Sep 17 00:00:00 2001 From: Robert Strouse Date: Sat, 23 Dec 2023 12:16:00 -0800 Subject: [PATCH] Fix issue with Invert Position #200 --- ConfigSettings.h | 2 +- SomfyController.ino.esp32.bin | Bin 1273312 -> 1273312 bytes SomfyController.littlefs.bin | Bin 1441792 -> 1441792 bytes data/icons.css | 2 +- data/index.html | 8 ++--- data/index.js | 57 ++++++++++++++++++++++++---------- 6 files changed, 46 insertions(+), 23 deletions(-) diff --git a/ConfigSettings.h b/ConfigSettings.h index f2dd08f..a4ba0f1 100644 --- a/ConfigSettings.h +++ b/ConfigSettings.h @@ -3,7 +3,7 @@ #ifndef configsettings_h #define configsettings_h -#define FW_VERSION "v2.2.2e" +#define FW_VERSION "v2.2.2" enum DeviceStatus { DS_OK = 0, DS_ERROR = 1, diff --git a/SomfyController.ino.esp32.bin b/SomfyController.ino.esp32.bin index 8b655b36818abd7077623e3699a2a9404342dd64..742b5c618bca2f8c1beaec44ea01fea1ebca322c 100644 GIT binary patch delta 167 zcmaEG+xNk3-w7KORPUc?={ok?uH(O3N!(taKAl~6R-X9ZFZcKC439~VESx6`@&#;G zV60Gy!fS47C*?<@%#{tBgK+FZi+(66&#JoVv2gLk9EC9rU xKrFOIQ$W9N_xU&^b$8T;DDrvUx4tvEUCp1}*FJQ9* zV;vh~YV&;d_WA6LK+FWh%s|Wn#H>Kf2E-sa4j|?PVlE)&24Wr{<^^ItAm#^R0U#Cx wVxjHx*@YF-6j=(}%f7$O>~@~f{qNYB8m1Or-UE4>iz4JYcN8|io4qO+04k6_)c^nh diff --git a/SomfyController.littlefs.bin b/SomfyController.littlefs.bin index eaacbbbce47c8ae093c93ee90ba8d7e4699987a1..51ff4f0837f8b5a0c068f020a472b947c4daefc5 100644 GIT binary patch delta 3103 zcmaJ?eQ;FO70)JbH~aDKyXR(?kPkv0ArOOvY=T0JgsdniL17gf(K2LLvXRv!yOMOO zwVFi+Z7Y&!Y7TT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7z>D8vo(2^klG-I{|s%g-V(H5(f{OhcBmz*h$9t8)mkvG1IEip7er0;E?_Ra z{AcQ&cu3eWxtGSEAp!lGOA)*O1k3+VnJouifkB6i?}31Zr5$vzq+yrik}#5^=Mg_$ z6Wn7~VstwJKidmEd6@eij8&`D>9v8O9L-R|hyFL zjgb=&l`sG|*ntsUl_>4>LDqi(&(gf^(J*Gm2$%jvDuYstIY-}!S%JOTqFAo+iF2Cn zCcdhXw_Zct(f>=Hj{}3;!WHjAsr37WZr417WAFo-{l*)`b{8J5HYdp00WsAc3kVP1 z*DR)B@6|LGiJJtS*{k$+S-qx1{-HtKW>c5XF4x~K_S1`GFIP@aoDX#2(L@ak=#b{9~M@PlO4y{-ztSuLl<-wSk?!?GZQGy%Cf`QK+6=U$7 zqqM4UT+}&?5@ITLx@X7N5JvxLD3jIQ;*gFN!)7j8kJ3bXUl9cu+b?#?zJ&P5u9d0= zLmiy{WM>L454q}7gNHrRY)7;U*>j;8dgZVm4Aub#z>o& ja?VQ1jY;R7zWj?7wsBi*fqXJInMc|J1(!RY2MhiO+Mj4D diff --git a/data/icons.css b/data/icons.css index d5e90bb..c9e994b 100644 --- a/data/icons.css +++ b/data/icons.css @@ -888,7 +888,7 @@ i.icss-lightbulb { border-width: 0.068em; border-style: solid; border-radius: 100% 100% 100% .2em; - background-color: rgba(255,255,0, var(--shade-position, 0%)); + background-color: rgba(255,255,0, var(--fpos, 0%)); left: 50%; transform: translateX(-50%) rotate(-45deg); bottom: .11em; diff --git a/data/index.html b/data/index.html index 6ab9306..7276598 100644 --- a/data/index.html +++ b/data/index.html @@ -3,11 +3,11 @@ - - - + + + - +
diff --git a/data/index.js b/data/index.js index 9e98102..10d9a87 100644 --- a/data/index.js +++ b/data/index.js @@ -1252,7 +1252,7 @@ var security = new Security(); class General { initialized = false; - appVersion = 'v2.2.2e'; + appVersion = 'v2.2.2'; reloadApp = false; init() { if (this.initialized) return; @@ -2116,7 +2116,7 @@ class Somfy { let shade = shades[i]; let st = this.shadeTypes.find(x => x.type === shade.shadeType) || { type: shade.shadeType, ico: 'icss-window-shade' }; - divCfg += `
`; + divCfg += `
`; divCfg += `
`; //divCfg += ``; divCfg += `${shade.name}`; @@ -2124,15 +2124,15 @@ class Somfy { divCfg += `
`; divCfg += '
'; - divCtl += `
`; divCtl += ``; - divCtl += `" data-shadeid="${shade.shadeId}" style="--shade-position:${shade.position}%;vertical-align: top;">`; + divCtl += `" data-shadeid="${shade.shadeId}" style="--shade-position:${shade.flipPosition ? 100 - shade.position : shade.position}%;--fpos:${shade.position}%;vertical-align: top;">`; + //divCtl += `" data-shadeid="${shade.shadeId}" style="--shade-position:${shade.position}%;vertical-align: top;">`; divCtl += shade.tiltType !== 0 ? `
` : '
'; divCtl += `
`; @@ -2657,9 +2657,9 @@ class Somfy { console.log(state); let icons = document.querySelectorAll(`.somfy-shade-icon[data-shadeid="${state.shadeId}"]`); for (let i = 0; i < icons.length; i++) { - //icons[i].style.setProperty('--shade-position', `${state.flipPosition ? 100 - state.position : state.position}%`); - icons[i].style.setProperty('--shade-position', `${state.position}%`); - + icons[i].style.setProperty('--shade-position', `${state.flipPosition ? 100 - state.position : state.position}%`); + icons[i].style.setProperty('--fpos', `${state.position}%`); + //icons[i].style.setProperty('--shade-position', `${state.position}%`); } if (state.tiltType !== 0) { let tilts = document.querySelectorAll(`.icss-window-tilt[data-shadeid="${state.shadeId}"]`); @@ -2695,7 +2695,7 @@ class Somfy { } } procRemoteFrame(frame) { - console.log(frame); + //console.log(frame); document.getElementById('spanRssi').innerHTML = frame.rssi; document.getElementById('spanFrameCount').innerHTML = parseInt(document.getElementById('spanFrameCount').innerHTML, 10) + 1; let lnk = document.getElementById('divLinking'); @@ -2875,10 +2875,12 @@ class Somfy { tilt.style.display = shade.tiltType !== 0 ? '' : 'none'; tilt.setAttribute('data-tiltposition', shade.tiltPosition); tilt.setAttribute('data-shadeid', shade.shadeId); - //ico.style.setProperty('--shade-position', `${shade.flipPosition ? 100 - shade.position : shade.position}%`); - //ico.style.setProperty('--tilt-position', `${shade.flipPosition ? 100 - shade.tiltPosition : shade.tiltPosition}%`); - ico.style.setProperty('--shade-position', `${shade.position}%`); - ico.style.setProperty('--tilt-position', `${shade.tiltPosition}%`); + ico.style.setProperty('--shade-position', `${shade.flipPosition ? 100 - shade.position : shade.position}%`); + ico.style.setProperty('--fpos', `${shade.position}%`); + + ico.style.setProperty('--tilt-position', `${shade.flipPosition ? 100 - shade.tiltPosition : shade.tiltPosition}%`); + //ico.style.setProperty('--shade-position', `${shade.position}%`); + //ico.style.setProperty('--tilt-position', `${shade.tiltPosition}%`); ico.setAttribute('data-shadeid', shade.shadeId); somfy.onShadeBitLengthChanged(document.getElementById('selShadeBitLength')); @@ -3028,6 +3030,16 @@ class Somfy { if (err) ui.serviceError(err); else this.updateShadeList(); console.log(shade); + let ico = document.getElementById('icoShade'); + let tilt = ico.parentElement.querySelector('i.icss-window-tilt'); + tilt.style.display = shade.tiltType !== 0 ? '' : 'none'; + tilt.setAttribute('data-tiltposition', shade.tiltPosition); + tilt.setAttribute('data-shadeid', shade.shadeId); + ico.style.setProperty('--shade-position', `${shade.flipPosition ? 100 - shade.position : shade.position}%`); + ico.style.setProperty('--fpos', `${shade.position}%`); + + ico.style.setProperty('--tilt-position', `${shade.flipPosition ? 100 - shade.tiltPosition : shade.tiltPosition}%`); + }); } } @@ -3077,7 +3089,7 @@ class Somfy { ui.serviceError(err); } else { - console.log(shades); + //console.log(shades); // Create the shades list. this.setShadesList(shades); } @@ -3165,6 +3177,8 @@ class Somfy { document.getElementsByName('shadeDownTime')[0].value = shade.downTime; let ico = document.getElementById('icoShade'); ico.style.setProperty('--shade-position', `${shade.flipPosition ? 100 - shade.position : shade.position}%`); + ico.style.setProperty('--fpos', `${shade.position}%`); + //ico.style.setProperty('--shade-position', `${shade.position}%`); ico.setAttribute('data-shadeid', shade.shadeId); if (shade.paired) { document.getElementById('btnUnpairShade').style.display = 'inline-block'; @@ -3197,6 +3211,8 @@ class Somfy { document.getElementsByName('shadeDownTime')[0].value = shade.downTime; let ico = document.getElementById('icoShade'); ico.style.setProperty('--shade-position', `${shade.flipPosition ? 100 - shade.position : shade.position}%`); + ico.style.setProperty('--fpos', `${shade.position}%`); + //ico.style.setProperty('--shade-position', `${shade.position}%`); ico.setAttribute('data-shadeid', shade.shadeId); if (shade.paired) { document.getElementById('btnUnpairShade').style.display = 'inline-block'; @@ -3752,19 +3768,26 @@ class Somfy { console.log('Closing shade positioner'); ctls[i].remove(); } + switch (parseInt(shade.getAttribute('data-shadetype'), 10)) { + case 5: + case 9: + case 10: + return; + } let tiltType = parseInt(shade.getAttribute('data-tilt'), 10) || 0; let currPos = parseInt(shade.getAttribute('data-target'), 0); let elname = shade.querySelector(`.shadectl-name`); let shadeName = elname.innerHTML; let html = `
${shadeName}
`; + let lbl = makeBool(shade.getAttribute('data-flipposition')) ? '% Open' : '% Closed'; if (tiltType !== 3) { html += ``; - html += ``; + html += ``; } if (tiltType > 0) { let currTiltPos = parseInt(shade.getAttribute('data-tilttarget'), 10); html += ``; - html += ``; + html += ``; } html += `
`; let div = document.createElement('div');