mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-01 04:09:17 +00:00
fix: deduplicate entity markers from parent devices
Issue: #226 User-Visible: yes
This commit is contained in:
@@ -418,6 +418,36 @@ export const MUTANTS = [
|
||||
replace: " if (false && input.type === 'passage') {",
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'entity-marker-kept-in-parent-device',
|
||||
guard: 'npx tsc -p tsconfig.test.json && node scripts/fix-test-build.mjs '
|
||||
+ '&& node --test --test-name-pattern="entity marker owns its entity|partial auto parent" '
|
||||
+ 'test/devices.test.mjs',
|
||||
because: 'an explicitly placed entity must be removed from the residual automatic parent '
|
||||
+ 'so state, action and light projection cannot render the same HA channel twice',
|
||||
patches: [{
|
||||
file: 'src/devices.ts',
|
||||
find: ' !owned.has(entityId) && !hass?.entities?.[entityId]?.hidden),',
|
||||
replace: ' !hass?.entities?.[entityId]?.hidden),',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'entity-marker-parent-seeded',
|
||||
guard: 'npx tsc -p tsconfig.test.json && node scripts/fix-test-build.mjs '
|
||||
+ '&& node --test --test-name-pattern="seedHiddenBindings: entity ownership" '
|
||||
+ 'test/devices.test.mjs',
|
||||
because: 'the first-run seeder must share residual ownership with buildDevices or it can '
|
||||
+ 'materialise the removed automatic duplicate as a permanent hidden device marker',
|
||||
patches: [{
|
||||
file: 'src/devices.ts',
|
||||
find: ' const entsBy = entitiesByDevice(h);\n'
|
||||
+ ' const ownership = entityMarkerOwnership(markers, fullHass);\n'
|
||||
+ ' const marked = new Set(markers.map((m) => m.binding));',
|
||||
replace: ' const entsBy = entitiesByDevice(h);\n'
|
||||
+ ' const ownership = entityMarkerOwnership([], fullHass);\n'
|
||||
+ ' const marked = new Set(markers.map((m) => m.binding));',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'manual-room-device-area-fallback',
|
||||
guard: 'npx tsc -p tsconfig.test.json && node scripts/fix-test-build.mjs '
|
||||
|
||||
Reference in New Issue
Block a user