mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-04 13:48:57 +00:00
test: close device presentation review findings
Issue: #267 User-Visible: no
This commit is contained in:
@@ -27,7 +27,7 @@ export type PresentationReason =
|
||||
| 'orphaned';
|
||||
|
||||
export type BindingPresentationLifecycle =
|
||||
| 'active' | 'ha_disabled' | 'orphaned' | 'unverified';
|
||||
| 'active' | 'ha_disabled' | 'orphaned';
|
||||
|
||||
export type PresentationFace = 'icon' | 'value';
|
||||
export type ValueFallbackReason =
|
||||
@@ -77,8 +77,7 @@ export function resolveDevicePresentationPolicy(
|
||||
): DevicePresentationPolicyResult {
|
||||
const decisions: string[] = [];
|
||||
const bindingUnavailable = input.bindingLifecycle === 'ha_disabled'
|
||||
|| input.bindingLifecycle === 'orphaned'
|
||||
|| input.bindingLifecycle === 'unverified';
|
||||
|| input.bindingLifecycle === 'orphaned';
|
||||
|
||||
let effectiveHidden = false;
|
||||
if (input.bindingLifecycle === 'ha_disabled') {
|
||||
@@ -91,8 +90,6 @@ export function resolveDevicePresentationPolicy(
|
||||
decisions.push('lifecycle.user_hidden_preview');
|
||||
} else if (input.bindingLifecycle === 'orphaned') {
|
||||
decisions.push('lifecycle.orphaned_diagnostic');
|
||||
} else if (input.bindingLifecycle === 'unverified') {
|
||||
decisions.push('lifecycle.unverified_diagnostic');
|
||||
} else {
|
||||
decisions.push('lifecycle.active');
|
||||
}
|
||||
|
||||
@@ -585,7 +585,7 @@ export function resolveDevicePresentation(
|
||||
const haDisabled = status?.kind === 'ha_disabled';
|
||||
const orphaned = status?.kind === 'orphaned';
|
||||
const lifecycle: BindingPresentationLifecycle = haDisabled ? 'ha_disabled'
|
||||
: orphaned ? 'orphaned' : status?.kind === 'unverified' ? 'unverified' : 'active';
|
||||
: orphaned ? 'orphaned' : 'active';
|
||||
const userHidden = d.userHidden === true || d.marker?.hidden === true;
|
||||
const combined = combineVisualSamples(sources.samples);
|
||||
const lockSource = sources.visualSources.find((source) => source.eid.startsWith('lock.'));
|
||||
|
||||
Reference in New Issue
Block a user