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 8b655b3..742b5c6 100644 Binary files a/SomfyController.ino.esp32.bin and b/SomfyController.ino.esp32.bin differ diff --git a/SomfyController.littlefs.bin b/SomfyController.littlefs.bin index eaacbbb..51ff4f0 100644 Binary files a/SomfyController.littlefs.bin and b/SomfyController.littlefs.bin differ 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');