mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 11:18:48 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c083be665 |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+2
-2
File diff suppressed because one or more lines are too long
@@ -104,7 +104,11 @@ const LIFECYCLE_ROLE_RANK = new Map<string, number>([
|
||||
['machine_state', 1], ['running_state', 1],
|
||||
['status', 2], ['device_status', 2], ['machine_status', 2],
|
||||
]);
|
||||
const LIFECYCLE_CONNECTIVITY_SEGMENTS = new Set(['wifi', 'connection', 'signal', 'battery']);
|
||||
// `error` sits here for the same reason as connectivity telemetry: an
|
||||
// `error_status` sensor describes a fault channel, not the appliance
|
||||
// lifecycle, and its `active` value must not paint the marker as working —
|
||||
// nor may registry order let it outrank a real `status` peer (review #164 M1).
|
||||
const LIFECYCLE_CONNECTIVITY_SEGMENTS = new Set(['wifi', 'connection', 'signal', 'battery', 'error']);
|
||||
|
||||
/** Rank a strict appliance lifecycle entity from generic HA metadata.
|
||||
* Russian/localised display text is deliberately not authority in #164. */
|
||||
|
||||
@@ -442,6 +442,9 @@ test('resolvedDeviceStateEntities: lifecycle matching rejects connectivity and l
|
||||
'sensor.washer_wifi_status': {
|
||||
entity_id: 'sensor.washer_wifi_status', original_name: 'WiFi Status',
|
||||
},
|
||||
'sensor.washer_error_status': {
|
||||
entity_id: 'sensor.washer_error_status', translation_key: 'error_status',
|
||||
},
|
||||
'sensor.washer_localised': { entity_id: 'sensor.washer_localised' },
|
||||
'sensor.washer_run_state': {
|
||||
entity_id: 'sensor.washer_run_state', entity_category: 'config',
|
||||
@@ -457,6 +460,8 @@ test('resolvedDeviceStateEntities: lifecycle matching rejects connectivity and l
|
||||
'switch.washer_power': { state: 'on', attributes: {} },
|
||||
'switch.washer_child_lock': { state: 'off', attributes: {} },
|
||||
'sensor.washer_wifi_status': { state: 'connected', attributes: {} },
|
||||
// a fault channel reporting `active` must not become the working signal
|
||||
'sensor.washer_error_status': { state: 'active', attributes: {} },
|
||||
'sensor.washer_localised': { state: 'start', attributes: { friendly_name: 'Статус' } },
|
||||
'sensor.washer_run_state': { state: 'start', attributes: {} },
|
||||
'sensor.washer_stage': { state: 'Rinse', attributes: {} },
|
||||
|
||||
Reference in New Issue
Block a user