mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-08 07:29:13 +00:00
fix(zigbee): allow explicit retry after transient reload failure (#800)
Issue: #800 User-Visible: yes
This commit is contained in:
@@ -148,7 +148,15 @@ async function capability(cache: Cache, hass: ZigbeeTopologyHass): Promise<void>
|
||||
const result = recordOf(await hass.callWS({ type: 'houseplan/config/get' }));
|
||||
if (result?.zigbee_scan_api !== 1) throw fail('backend_required');
|
||||
})();
|
||||
await cache.capability;
|
||||
const pending = cache.capability;
|
||||
try {
|
||||
await pending;
|
||||
} catch (error) {
|
||||
// A transient reload failure must not poison later explicit actions. Do not
|
||||
// retry here, or let an old rejection clear a newer owner's capability check.
|
||||
if (cache.capability === pending) cache.capability = undefined;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
function startFeed(cache: Cache, hass: ZigbeeTopologyHass): void {
|
||||
if (!cache.listeners.size || cache.feedPending || cache.unsubscribe) return;
|
||||
|
||||
Reference in New Issue
Block a user