mirror of
https://github.com/Matysh/houseplan-card
synced 2026-08-01 00:48:29 +00:00
v1.52.2: the v1.52.1 review (HP-1521-01, HP-1521-02)
- HP-1521-01: the plan-mode assertion looked for ANY .dev.on and the lit kettle satisfied it — a false positive hiding the very regression it guards. It targets d_lamp now (kettle asserted separately), and the mutation check proves it: reverting the v1.52.1 gate fails the smoke. - HP-1521-02: the checklist entry and the _stateClass comment still said 'yellow in every fill mode'. Both now state the two-part contract: the state predicate is the glow-pool condition; the renderer keeps the badge only where the spot is not drawn.
This commit is contained in:
@@ -36,7 +36,7 @@ import { cardStyles } from './styles';
|
||||
import { fitInSquare, contentBounds, spaceModels } from './space-geometry';
|
||||
import { langOf, t, type I18nKey } from './i18n';
|
||||
|
||||
const CARD_VERSION = '1.52.1';
|
||||
const CARD_VERSION = '1.52.2';
|
||||
const LS_KEY = 'houseplan_card_layout_v1';
|
||||
const LS_CFG = 'houseplan_card_cfg_v1'; // cache of the server config+layout for instant rendering
|
||||
const LS_ZOOM = 'houseplan_card_zoom_v1';
|
||||
@@ -1213,9 +1213,12 @@ class HouseplanCard extends LitElement {
|
||||
const controls = (d.marker?.controls || []).filter(isControllable);
|
||||
if (controls.length)
|
||||
return controls.some((e) => this.hass.states[e]?.state === 'on') ? 'on' : '';
|
||||
// A shining light makes its icon yellow in EVERY fill mode — and it is
|
||||
// the same condition that lights the glow pool, so the pool and the icon
|
||||
// cannot disagree (they used to read different entities).
|
||||
// A shining light yields 'on' here by the SAME condition that lights the
|
||||
// glow pool, so the pool and the state cannot disagree. Note the renderer
|
||||
// then STRIPS the class wherever the glow layer is actually visible —
|
||||
// there the spot is the one indicator (v1.52.0, owner's rule); the badge
|
||||
// stays yellow only where the spot is not drawn (other fills, the plan
|
||||
// editor).
|
||||
if (litLightEntity(this.hass, d)) return 'on';
|
||||
const p = d.primary ? this.hass.states[d.primary] : undefined;
|
||||
if (!p) return '';
|
||||
|
||||
Reference in New Issue
Block a user