mirror of
https://github.com/Matysh/houseplan-card
synced 2026-08-01 00:48:29 +00:00
v1.52.1: the v1.52.0 review (HP-1520-01/-02, HP-1513-01)
- HP-1520-01: the glow layer is hidden in the plan editor, but the yellow suppression still fired there — a lit lamp had NEITHER indicator. The gate now equals the layer's visibility (disp.fill === 'glow' && !this._markup), so the badge returns exactly where the spot is absent. - HP-1513-01: the static card ignored marker.size and marker.angle — the same stored marker looked different on the two cards. It mirrors --dev-scale and the icon rotation now; geometry only, no live dressing. - HP-1520-02: TESTING/UX-MODES still demanded the removed RGB icon tint, and the lightC comment described the old use. All three brought to the v1.52.0 contract. smoke_light_badges grew the editor-mode vectors; new smoke_size_angle_parity asserts the x3 ratio inside each card (absolute px are incomparable across containers) and rotation on both. Inventory: 147 / 51 / 43 / 71.
This commit is contained in:
+13
-9
@@ -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.0';
|
||||
const CARD_VERSION = '1.52.1';
|
||||
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';
|
||||
@@ -4152,7 +4152,7 @@ class HouseplanCard extends LitElement {
|
||||
${this._renderOpenings(disp)}
|
||||
</svg>
|
||||
<div class="devlayer" style="--icon-size:${((iconPct * vb[2] * (this._kiosk ? this._kioskScale.icon : 1)) / view.w).toFixed(3)}cqw;--rl-font:${this._kiosk ? this._kioskScale.font : 1}">
|
||||
${devs.map((d) => this._renderDevice(d, view, showLqi, disp.fill === 'glow'))}
|
||||
${devs.map((d) => this._renderDevice(d, view, showLqi, disp.fill === 'glow' && !this._markup))}
|
||||
${this._renderOpeningLocks(view)}
|
||||
${disp.showNames || this._markup
|
||||
? space.rooms.map((r) => this._renderRoomLabel(r, space, view, disp))
|
||||
@@ -4210,11 +4210,13 @@ class HouseplanCard extends LitElement {
|
||||
// and no live numbers either (HP-1510-02): no value text, no temperature,
|
||||
// no humidity, no LQI badge, no state-morphed icon. The base icon and the
|
||||
// name stay — enough to recognise the device and open its dialog.
|
||||
// The owner's rule for LIGHT SOURCES (2026-07-29): in glow fill the
|
||||
// indicator IS the glow spot — the badge stays standard, on or off; in
|
||||
// every other fill a lit source goes plain yellow like a heating TRV.
|
||||
// "Source" is exactly the litLightEntity condition that casts the spot,
|
||||
// so a lit socket or fan keeps its yellow even in glow fill.
|
||||
// The owner's rule for LIGHT SOURCES (2026-07-29): where the glow layer
|
||||
// is VISIBLE, the indicator IS the glow spot — the badge stays standard,
|
||||
// on or off; wherever the spot is not drawn (other fills, the plan
|
||||
// editor) a lit source goes plain yellow like a heating TRV. The gate
|
||||
// must equal the layer's visibility, or a mode ends up with neither
|
||||
// indicator (HP-1520-01). "Source" is exactly the litLightEntity
|
||||
// condition that casts the spot, so a lit socket keeps its yellow.
|
||||
let cls = d.hidden ? '' : this._stateClass(d);
|
||||
if (glowFill && cls === 'on' && litLightEntity(this.hass, d)) cls = '';
|
||||
const temp = d.hidden ? null : this._liveTemp(d);
|
||||
@@ -4240,8 +4242,10 @@ class HouseplanCard extends LitElement {
|
||||
const icon = this._config?.live_states && !d.hidden
|
||||
? stateIcon(d.icon, domain, primarySt?.attributes?.device_class, primarySt?.state, !!m?.icon)
|
||||
: d.icon;
|
||||
// RGB lights color the icon (and the ripple, unless a custom ripple color is set);
|
||||
// an icon with controlled targets takes the color of its first lit RGB target
|
||||
// v1.52.0: a lamp's colour lives in its GLOW and in the ripple fallback
|
||||
// only — the icon/border tint is gone. lightC is still computed (from the
|
||||
// marker's first lit RGB target, else the primary light) purely to feed
|
||||
// --ripple-color when no explicit ripple colour is set.
|
||||
const ctrl = (m?.controls || []).filter(isControllable);
|
||||
const lightC = this._config?.live_states && !d.hidden
|
||||
? ctrl.length
|
||||
|
||||
+9
-2
@@ -121,8 +121,15 @@ export function renderSpaceStatic(o: StaticRenderOpts): TemplateResult | null {
|
||||
const p = markerPos(d, o.layout, o.cfg, defPos, space);
|
||||
const left = ((p.x - vb[0]) / vb[2]) * 100;
|
||||
const top = ((p.y - vb[1]) / vb[3]) * 100;
|
||||
return html`<div class="dev ${d.virtual ? 'virtual' : ''}" style="left:${left}%;top:${top}%">
|
||||
<ha-icon icon="${d.icon}"></ha-icon>
|
||||
// per-marker size and rotation, exactly as on the full card (HP-1513-01):
|
||||
// the same stored marker must look the same on both cards. Geometry only —
|
||||
// no live-state dressing here, the static card stays a schematic.
|
||||
const scale = Number(d.marker?.size) > 0 ? Number(d.marker!.size) : 1;
|
||||
const angle = Number(d.marker?.angle) || 0;
|
||||
const st = [`left:${left}%`, `top:${top}%`];
|
||||
if (scale !== 1) st.push(`--dev-scale:${scale}`);
|
||||
return html`<div class="dev ${d.virtual ? 'virtual' : ''}" style="${st.join(';')}">
|
||||
<ha-icon icon="${d.icon}" style=${angle ? `transform:rotate(${angle}deg)` : nothing}></ha-icon>
|
||||
</div>`;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user