diff --git a/demo/smoke_cover_tap.mjs b/demo/smoke_cover_tap.mjs index 5d63b685..e669c1d1 100644 --- a/demo/smoke_cover_tap.mjs +++ b/demo/smoke_cover_tap.mjs @@ -25,7 +25,10 @@ const out = await page.evaluate(async () => { const gateEntity = (state, attrs) => ({ entity_id: 'cover.gate', state, - attributes: { friendly_name: 'Gate', ...attrs }, + // Declare the capabilities exercised below. Issue #94 intentionally + // resolves services fail-closed, so an entity without feature metadata is + // not a valid fixture for open / close / stop dispatch. + attributes: { friendly_name: 'Gate', supported_features: 11, ...attrs }, }); /** Push a cover state into hass keeping the service recorder in place. */ const setCover = async (state, attrs = {}) => { diff --git a/demo/smoke_tap_ctx.mjs b/demo/smoke_tap_ctx.mjs index 629ed781..532a002a 100644 --- a/demo/smoke_tap_ctx.mjs +++ b/demo/smoke_tap_ctx.mjs @@ -4,16 +4,19 @@ const res = await page.evaluate(async () => { const out = {}; const c = window.__card; const sr = () => c.shadowRoot || c.renderRoot; - // 1) в селекте действий 3 опции, дефолт «Карточка устройства» + // 1) Единый селектор содержит ровно четыре актуальных действия; + // legacy cover и пустая авто-опция в UI не возвращаются. c._setMode('devices'); await c.updateComplete; // v1.39.0: у ЛАМП дефолт 'toggle', поэтому для проверки дефолта 'info' // берём заведомо не-световое устройство const dev = c._devices.find((d) => !d.virtual && d.primary && !d.primary.startsWith('light.')); c._openMarkerDialog(dev); await c.updateComplete; - const sel = [...sr().querySelectorAll('hp-dialog select')].find((s) => - [...s.options].some((o) => o.textContent === c._t('tap.toggle'))); - out.threeOptions = sel && sel.options.length === 4; // + «Запустить…» (2026-07-29) - out.noAutoOption = sel && ![...sel.options].some((o) => o.value === ''); + const sel = sr().querySelector('#marker-tap-action'); + const values = sel ? [...sel.options].map((o) => o.value) : []; + out.fourCurrentOptions = JSON.stringify(values) === JSON.stringify([ + 'info', 'more-info', 'toggle', 'run', + ]); + out.noLegacyOptions = !values.includes('') && !values.includes('cover'); out.defaultInfo = sel && sel.value === 'info'; c._markerDialog = null; await c.updateComplete; // 2) правый клик в Просмотре открывает more-info