feat: show Z-Wave scan runs in Scan History

Scan History now recognises kind=zwave: dedicated Z-Wave filter chip,
badge (RadioTower, orange) and import-done toast, instead of falling
back to the generic IP type.

ha-relevant: yes
This commit is contained in:
Pouzor
2026-06-26 13:10:12 +02:00
parent 8faf5c1c79
commit 9b8f15bec3
2 changed files with 45 additions and 11 deletions
@@ -61,6 +61,17 @@ const ZIGBEE_RUN = {
error: null,
}
const ZWAVE_RUN = {
id: 'run-5',
status: 'done',
kind: 'zwave',
ranges: [],
devices_found: 5,
started_at: new Date().toISOString(),
finished_at: new Date().toISOString(),
error: null,
}
function renderModal() {
return render(
<TooltipProvider>
@@ -155,4 +166,14 @@ describe('ScanHistoryModal', () => {
expect(screen.getByText('7 found')).toBeDefined()
expect(screen.queryByText('3 found')).toBeNull()
})
it('filters by zwave kind', async () => {
vi.mocked(scanApi.runs).mockResolvedValue({ data: [DONE_RUN, ZWAVE_RUN] } as never)
renderModal()
await waitFor(() => expect(screen.getAllByText('done').length).toBe(2))
fireEvent.click(screen.getByRole('button', { name: 'Z-Wave' }))
// Only the zwave run (5 found) remains
expect(screen.getByText('5 found')).toBeDefined()
expect(screen.queryByText('3 found')).toBeNull()
})
})