Skip to content

Commit a86f899

Browse files
committed
feat: graph panel features, scan hardening, template fix
1 parent 3d41bab commit a86f899

48 files changed

Lines changed: 4557 additions & 2534 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,33 @@ All notable changes to EntityMap will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.0] - 2026-06-16
9+
10+
### Added
11+
12+
- Graph export service `entitymap.export`, returning the full graph, fragility findings, and last-scan metadata as a response.
13+
- Graph panel: node sizing by importance, search-match highlighting, focus mode (double-click a node to isolate its neighborhood), area and domain filters, path-finding between two nodes, an on-canvas minimap, zoom controls (in / out / fit / reset), PNG export, a "showing N of M nodes" notice for capped graphs, and a performance mode that simplifies very large graphs.
14+
- Graph panel accessibility and theming: full keyboard navigation, a screen-reader live region, dark-mode polish, a colorblind-safe palette toggle, and a compact density toggle (both remembered).
15+
- Curved routing for parallel edges and direction arrowheads.
16+
- `Last scan` sensor attributes: `status`, `duration_seconds`, and `adapter_errors`.
17+
- Summary sensors restore their last value across restarts.
18+
- Test coverage for the automation, script, scene, and template adapters, plus the hierarchy builder, sensors, and graph builder.
19+
20+
### Changed
21+
22+
- Template entities that referenced other entities no longer appear unconnected: the template adapter now resolves references from each helper's own config entry.
23+
- The first scan runs immediately when the integration is added while Home Assistant is already running (previously it waited for a start event that had already fired).
24+
- Registry-change rescans are debounced so a burst of changes collapses into a single scan.
25+
- Fragility findings are computed once per scan and reused by the sensors, panel, and repairs.
26+
- The panel is served as a static module directory and split into ES-module mixins; its assets are sent with `Cache-Control: no-store` so updates apply without cache issues.
27+
- Internal cleanup: WebSocket API moved to `websocket.py`, the hierarchy builder to `hierarchy.py`, shared adapter parsers to `adapters/_config_parse.py`.
28+
- Shortened the summary-sensor display names (Nodes, Dependencies, Issues, Last scan).
29+
30+
### Fixed
31+
32+
- Detail drawer no longer stays open and empty when switching tabs or changing filters.
33+
- Type filters now apply consistently in the Issues view and are hidden in the structural Hierarchy view.
34+
835
## [1.0.1] - 2026-06-15
936

1037
### Fixed

README.md

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,18 @@ Ready-made Lovelace cards - status tiles, gauges, history graphs, and a rescan b
9898

9999
## Key Features
100100

101-
- **Interactive dependency graph** - Zoomable, draggable force-directed visualization with color-coded node types
101+
- **Interactive dependency graph** - Zoomable, draggable force-directed visualization; nodes are sized by importance and coded by color and shape
102+
- **Focus, search & path-finding** - Isolate a node's neighborhood, highlight search matches, and trace the dependency path between any two nodes
103+
- **Filters** - By node type (chips or the clickable legend), and by area or domain
102104
- **Hierarchy view** - Area → Device → Entity tree with list and visual D3 tree modes (horizontal & vertical)
103105
- **Impact analysis** - Select any node to see exactly what breaks if you remove, disable, or replace it
104106
- **Fragility detection** - Automatically find device_id references, missing entities, stale references, tight coupling
105107
- **Migration guidance** - Step-by-step recommendations for safely replacing devices or entities
106108
- **Repair issues** - Actionable warnings surfaced in Home Assistant's Repairs dashboard
107-
- **Three services** - `entitymap.scan`, `entitymap.analyze_impact`, `entitymap.get_dependencies`
108-
- **Summary sensors** - Total nodes, total dependencies, fragility issue count, last scan time
109+
- **Accessible & themable** - Keyboard navigation, screen-reader announcements, dark mode, a colorblind-safe palette, and a compact density mode
110+
- **Minimap, zoom controls & PNG export** - Navigate large graphs and export the current view as an image
111+
- **Services** - `entitymap.scan`, `entitymap.export`, `entitymap.analyze_impact`, `entitymap.get_dependencies`
112+
- **Summary sensors** - Node count, dependency count, fragility issue count, last scan time (with scan status, duration, and error attributes)
109113
- **WebSocket API** - Full programmatic access for custom dashboards and automations
110114
- **Fully async** - No blocking I/O; uses async adapters for all registry and config access
111115
- **Zero external dependencies** - Uses only libraries bundled with Home Assistant
@@ -222,11 +226,19 @@ EntityMap adds a panel to your Home Assistant sidebar. Here's what you can do:
222226

223227
### Graph View (default)
224228

225-
- **Pan and zoom** - Scroll to zoom, drag the background to pan
229+
- **Pan and zoom** - Scroll to zoom, or use the on-canvas **+ / − / ⤢ fit / ⟲ reset** buttons; drag the background to pan
230+
- **Minimap** - Corner overview showing the whole graph and your current viewport
226231
- **Drag nodes** - Click and drag any node to rearrange the layout
232+
- **Node size** - Larger nodes have more dependencies (higher importance)
227233
- **Click a node** - Opens the detail panel with impact analysis, fragility findings, and migration guidance
228-
- **Filter by type** - Use the chips at the top to show/hide specific node types (devices, entities, automations, etc.)
229-
- **Search** - Type in the search box to filter nodes by name or ID; neighbors of matched nodes are shown too
234+
- **Double-click a node** - Focus mode: isolate that node and its immediate neighbors (Esc or "Clear" to exit)
235+
- **Filter by type** - Use the chips, or click items in the legend (it doubles as a filter)
236+
- **Filter by area or domain** - Narrow the graph with the scope dropdown
237+
- **Search** - Filter nodes by name or ID (neighbors of matches are kept); matches get a highlight ring
238+
- **🔗 Path** - Toggle path mode, then click two nodes to highlight the dependency chain between them
239+
- **⬇ PNG** - Download the current graph view as an image
240+
- **Display toggles** - Compact density (⇕) and colorblind-safe palette (◑) in the header; both are remembered
241+
- **Performance** - Very large graphs hide labels automatically to stay smooth
230242

231243
### Issues View
232244

@@ -259,10 +271,12 @@ EntityMap creates a single device called **EntityMap** with the following entiti
259271

260272
| Entity | Type | What it shows |
261273
|--------|------|---------------|
262-
| **Total nodes** | Sensor | Number of nodes in the dependency graph (devices, entities, automations, etc.) |
263-
| **Total edges** | Sensor | Number of dependency relationships discovered |
264-
| **Fragility issues** | Sensor | Number of fragility findings across the entire graph. 0 = clean |
265-
| **Last scan** | Sensor | Timestamp of the most recent completed scan |
274+
| **Nodes** | Sensor | Number of nodes in the dependency graph (devices, entities, automations, etc.) |
275+
| **Dependencies** | Sensor | Number of dependency relationships discovered |
276+
| **Issues** | Sensor | Number of fragility findings across the entire graph. 0 = clean |
277+
| **Last scan** | Sensor | Timestamp of the most recent completed scan. Attributes: `status`, `duration_seconds`, `adapter_errors` |
278+
279+
Entities are shown in Home Assistant as `EntityMap Nodes`, `EntityMap Dependencies`, etc. (the `EntityMap` prefix is the device name). In dashboard cards you can drop the prefix with a per-entity `name:` (the bundled cards already do this).
266280

267281
### Actions
268282

@@ -294,6 +308,16 @@ Trigger a full dependency scan. Returns node and edge counts.
294308
service: entitymap.scan
295309
```
296310
311+
### `entitymap.export`
312+
313+
Return the full dependency graph, fragility findings, and last-scan metadata as a service response (useful for templates, scripts, or backups).
314+
315+
```yaml
316+
service: entitymap.export
317+
```
318+
319+
Returns: `nodes`, `edges`, `node_count`, `edge_count`, `findings`, `last_scan`, `scan_status`.
320+
297321
### `entitymap.analyze_impact`
298322

299323
Analyze what would break if a specific node were removed, disabled, or replaced.

0 commit comments

Comments
 (0)