diff --git a/demo/smoke_cover_no_plate.mjs b/demo/smoke_cover_no_plate.mjs index 68e86643..4db58c22 100644 --- a/demo/smoke_cover_no_plate.mjs +++ b/demo/smoke_cover_no_plate.mjs @@ -35,7 +35,8 @@ const out = await page.evaluate(async () => { const YELLOW = probe('var(--hp-on)'); // «включено» const ORANGE = probe('var(--hp-open)'); // «открыто» frame const NEUTRAL = probe('light-dark(#fff, #252525)'); // package theme fallback - const AMBER = probe('#F0A00C'); // package working/unlocked core + const UNLOCKED_RED = probe('#F0410C'); // owner palette #219 + const LOCKED_GREEN = probe('#66D17A'); // owner palette #219 o.tokensDiffer = new Set([YELLOW, ORANGE, NEUTRAL]).size === 3; o.yellowIsTheYellow = YELLOW === 'rgb(255, 212, 92)'; o.orangeIsTheOpenFrame = ORANGE === 'rgb(255, 159, 67)'; @@ -170,10 +171,10 @@ const out = await page.evaluate(async () => { o.lockMarkerFound = !!lockEl; o.windowMarkerFound = !!winEl; o.unlockedLockKeepsTheFrame = !!lockEl && lockEl.classList.contains('lock-unlocked') - && getComputedStyle(lockEl.querySelector('.device-core')).backgroundColor === AMBER; + && getComputedStyle(lockEl.querySelector('.device-core')).backgroundColor === UNLOCKED_RED; o.openWindowKeepsTheFrame = !!winEl && winEl.classList.contains('open') && getComputedStyle(winEl.querySelector('.device-core')).backgroundColor === ORANGE; - // …and a locked lock keeps the distinct package face: dark core + white glyph. + // …and a locked lock keeps the #219 green face with a theme-aware glyph. c.hass = { ...c.hass, states: { ...c.hass.states, 'lock.front_door': { entity_id: 'lock.front_door', state: 'locked', attributes: { friendly_name: 'Front door' } } } }; c.requestUpdate(); @@ -181,12 +182,12 @@ const out = await page.evaluate(async () => { await new Promise((r) => setTimeout(r, 300)); const lockedEl = elOf(dev('d_lock')); const lockedCore = lockedEl?.querySelector('.device-core'); - const lockedFace = lockedEl?.classList.contains('theme-dark') + const lockedGlyph = lockedEl?.classList.contains('theme-dark') ? 'rgb(37, 37, 37)' - : 'rgb(0, 0, 0)'; + : 'rgb(255, 255, 255)'; o.lockedLockKeepsPackageFace = !!lockedEl?.classList.contains('lock-locked') - && getComputedStyle(lockedCore).backgroundColor === lockedFace - && getComputedStyle(lockedCore).color === 'rgb(255, 255, 255)'; + && getComputedStyle(lockedCore).backgroundColor === LOCKED_GREEN + && getComputedStyle(lockedCore).color === lockedGlyph; // a VALVE keeps the frame too: nothing morphs its icon, so the frame is the // only thing it has to say «открыт» with (deliberately left alone) diff --git a/demo/smoke_opening_binding.mjs b/demo/smoke_opening_binding.mjs index 9cef3a10..68870abf 100644 --- a/demo/smoke_opening_binding.mjs +++ b/demo/smoke_opening_binding.mjs @@ -87,17 +87,17 @@ const out = await page.evaluate(async () => { Math.abs(state.shellCoreRatio - 1.26875) < 0.03 && Math.abs(state.glyphCoreRatio - 0.55) < 0.03 && state.footprint > 0)) - && lockVisualMatrix.light.locked.core === 'rgb(0, 0, 0)' - && lockVisualMatrix.light.locked.shell === 'rgb(0, 0, 0)' + && lockVisualMatrix.light.locked.core === 'rgb(102, 209, 122)' + && lockVisualMatrix.light.locked.shell === 'rgb(102, 209, 122)' && lockVisualMatrix.light.locked.glyph === 'rgb(255, 255, 255)' - && lockVisualMatrix.dark.locked.core === 'rgb(37, 37, 37)' - && lockVisualMatrix.dark.locked.shell === 'rgb(37, 37, 37)' - && lockVisualMatrix.dark.locked.glyph === 'rgb(255, 255, 255)' - && lockVisualMatrix.light.unlocked.core === 'rgb(240, 160, 12)' - && lockVisualMatrix.light.unlocked.shell === 'rgb(240, 160, 12)' + && lockVisualMatrix.dark.locked.core === 'rgb(102, 209, 122)' + && lockVisualMatrix.dark.locked.shell === 'rgb(102, 209, 122)' + && lockVisualMatrix.dark.locked.glyph === 'rgb(37, 37, 37)' + && lockVisualMatrix.light.unlocked.core === 'rgb(240, 65, 12)' + && lockVisualMatrix.light.unlocked.shell === 'rgb(240, 65, 12)' && lockVisualMatrix.light.unlocked.glyph === 'rgb(255, 255, 255)' - && lockVisualMatrix.dark.unlocked.core === 'rgb(240, 160, 12)' - && lockVisualMatrix.dark.unlocked.shell === 'rgb(240, 160, 12)' + && lockVisualMatrix.dark.unlocked.core === 'rgb(240, 65, 12)' + && lockVisualMatrix.dark.unlocked.shell === 'rgb(240, 65, 12)' && lockVisualMatrix.dark.unlocked.glyph === 'rgb(37, 37, 37)' && lockVisualMatrix.light.unknown.core === 'rgb(255, 255, 255)' && lockVisualMatrix.light.unknown.shell === 'rgb(188, 188, 188)'