How dummylabs/thewatchman works
Watchman is a Home Assistant integration and companion CLI that finds entity and service/action references in configuration files, checks them against Home Assistant, and presents missing or unavailable items. The main workflow configures the integration, scans YAML using heuristic parsing with persistent scan data, validates discovered references, then exposes diagnostics and reports. The graph also preserves configuration, notification, and CLI capabilities. Evidence is limited to the supplied excerpts, SOURCE INDEX references, and README; some internal wiring is therefore omitted rather than inferred.
Main entry points: coordinator.py Coordinator · parser_core.py Reference parser · __init__.py Integration lifecycle · services.py Report actions
Components 25
Integration setup
- Integration options
custom_components/watchman/config_flow.py - Integration lifecycle
custom_components/watchman/__init__.py - Integration settings
custom_components/watchman/const.py - Integration logger
custom_components/watchman/utils/logger.py
Configuration scanning
- Parser adapter
custom_components/watchman/hub.py - Reference parser
custom_components/watchman/utils/parser_core.py - Parser rules
custom_components/watchman/utils/parser_const.py - YAML loader
custom_components/watchman/utils/yaml_loader.py - Scan database
custom_components/watchman/utils/parser_core.py - Parser CLI
cli/parser.py
Validation and status
- Coordinator
custom_components/watchman/coordinator.py - Configuration utilities
custom_components/watchman/utils/utils.py
Reports and interfaces
- Diagnostic sensors
custom_components/watchman/sensor.py - Entity base
custom_components/watchman/entity.py - Entity registry helpers
custom_components/watchman/utils/entity.py - Report actions
custom_components/watchman/services.py - Report rendering
custom_components/watchman/utils/report.py - Text and button entities
custom_components/watchman/text.py - Refresh button
custom_components/watchman/button.py
Other components
- Home Assistant user
- Home Assistant
- HA configuration files
- HA states and registries
- HA notification action
- Report text file
Connections 25
- Home Assistant user → Integration options: configures
README.md - Integration options → Integration lifecycle: sets options
- Integration lifecycle → Parser adapter: creates
custom_components/watchman/__init__.py - Integration lifecycle → Coordinator: creates
custom_components/watchman/__init__.py - Integration lifecycle → Report actions: registers
custom_components/watchman/__init__.py - Parser adapter → Reference parser: invokes
custom_components/watchman/utils/parser_core.py - Reference parser → Parser rules: uses rules
custom_components/watchman/utils/parser_core.py - Reference parser → YAML loader: loads YAML
custom_components/watchman/utils/parser_core.py - Reference parser → HA configuration files: scans
README.md - Reference parser → Scan database: stores scan data
custom_components/watchman/utils/parser_core.py - Parser adapter → Coordinator: supplies parsed items
custom_components/watchman/coordinator.py - Coordinator → HA states and registries: checks references
- Coordinator → Parser adapter: gets parsed items
custom_components/watchman/coordinator.py - Coordinator → Configuration utilities: uses helpers
custom_components/watchman/coordinator.py - Coordinator → Diagnostic sensors: provides status
custom_components/watchman/sensor.py - Diagnostic sensors → Entity base: extends
custom_components/watchman/sensor.py - Diagnostic sensors → Entity registry helpers: uses
custom_components/watchman/sensor.py - Report actions → Coordinator: requests parsing
custom_components/watchman/services.py - Report actions → Report rendering: renders report
custom_components/watchman/services.py - Report rendering → Report text file: writes
custom_components/watchman/utils/report.py - Report rendering → HA notification action: calls action
custom_components/watchman/utils/report.py - Report actions → Home Assistant: registers actions
custom_components/watchman/services.py - Text and button entities → Coordinator: reads status
custom_components/watchman/text.py - Refresh button → Coordinator: triggers refresh
- Parser CLI → Reference parser: uses parser
cli/parser.py