# roxy228/pc-remote-net-plugin-home-assistant architecture

> Architecture diagram of the GitHub repository roxy228/pc-remote-net-plugin-home-assistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/roxy228/pc-remote-net-plugin-home-assistant
- Repository: https://github.com/roxy228/pc-remote-net-plugin-home-assistant

## Overview

PC Remote is a Home Assistant integration for pairing Windows PCs and controlling them through the existing authenticated PC Remote protocol. The main workflow is browser-initiated pairing into a stored profile, followed by panel, service, or entity actions routed through the command manager; Wake-on-LAN is a separate path. Voice configuration and confirmations form a distinct optional branch using Yandex.Station Intents. Source excerpts support the orchestration and storage links; panel/API and pairing details are also documented in the README.

Main entry points: [`custom_components/pc_remote/__init__.py`](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/__init__.py) (Integration entry), [`custom_components/pc_remote/storage.py`](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/storage.py) (Profile store), [`custom_components/pc_remote/manager.py`](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/manager.py) (Command manager), [`custom_components/pc_remote/voice.py`](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/voice.py) (Voice controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Integration setup"]
  node_setup_entry["Integration entry<br/>[__init__.py]"]
  node_config_flow["Config flow<br/>[config_flow.py]"]
  node_panel["Management panel<br/>[panel.js]"]
  node_panel_api["Panel API<br/>[http.py]"]
  node_constants["Integration constants<br/>[const.py]"]
end

subgraph group_pairing["Pairing and profiles"]
  node_pair_callback["Pairing callback<br/>[http.py]"]
  node_profile_model["Profile validation<br/>[models.py]"]
  node_profile_store[("Profile store<br/>[storage.py]")]
end

subgraph group_control["PC control"]
  node_manager["Command manager<br/>[manager.py]"]
  node_tcp_client["Secure TCP client<br/>[client.py]"]
  node_wol["Wake-on-LAN<br/>[manager.py]"]
  node_buttons["Command buttons<br/>[button.py]"]
  node_sensors["Status entities<br/>[sensor.py]"]
  node_binary_sensor["Connection entity<br/>[binary_sensor.py]"]
end

subgraph group_voice["Voice control"]
  node_voice_controller["Voice controller<br/>[voice.py]"]
  node_voice_package["Voice package<br/>[voice.py]"]
end

node_admin(("HA administrator"))
node_browser(("Pairing browser"))
node_windows(("Windows PC"))
node_ha(("Home Assistant"))
node_yandex(("Yandex Intents"))

node_admin -->|"configures"| node_config_flow
node_config_flow -->|"creates entry"| node_setup_entry
node_setup_entry -->|"loads"| node_profile_store
node_setup_entry -->|"creates"| node_manager
node_setup_entry -->|"creates"| node_voice_controller
node_setup_entry -->|"registers"| node_panel_api
node_setup_entry -->|"serves"| node_panel
node_admin -->|"manages PCs"| node_panel
node_panel -->|"requests actions"| node_panel_api
node_browser -->|"completes pairing"| node_pair_callback
node_windows -->|"sends credentials"| node_pair_callback
node_pair_callback -->|"validates profile"| node_profile_model
node_pair_callback -.->|"saves profile"| node_profile_store
node_profile_store -->|"loads profiles"| node_profile_model
node_panel_api -->|"reads and updates"| node_profile_store
node_panel_api -->|"executes commands"| node_manager
node_manager -->|"gets and saves"| node_profile_store
node_manager -->|"sends command"| node_tcp_client
node_tcp_client -->|"sends encrypted TCP"| node_windows
node_manager -->|"dispatches wake"| node_wol
node_wol -->|"calls WOL service"| node_ha
node_buttons -->|"executes action"| node_manager
node_sensors -->|"reads state"| node_profile_store
node_binary_sensor -->|"reads state"| node_profile_store
node_setup_entry -->|"sets up platforms"| node_buttons
node_setup_entry -->|"sets up platforms"| node_sensors
node_setup_entry -->|"sets up platforms"| node_binary_sensor
node_setup_entry -->|"registers voice actions"| node_voice_controller
node_panel_api -->|"configures and applies"| node_voice_controller
node_voice_controller -->|"generates package"| node_voice_package
node_voice_package -->|"provides intents"| node_yandex
node_yandex -->|"invokes voice actions"| node_setup_entry
node_voice_controller -->|"executes confirmed action"| node_manager
node_voice_controller -->|"reads settings"| node_profile_store

click node_setup_entry "https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/__init__.py"
click node_config_flow "https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/config_flow.py"
click node_panel "https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/www/panel.js"
click node_panel_api "https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/http.py"
click node_pair_callback "https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/http.py"
click node_profile_model "https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/models.py"
click node_profile_store "https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/storage.py"
click node_manager "https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/manager.py"
click node_tcp_client "https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/client.py"
click node_wol "https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/manager.py"
click node_buttons "https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/button.py"
click node_sensors "https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/sensor.py"
click node_binary_sensor "https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/binary_sensor.py"
click node_voice_controller "https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/voice.py"
click node_voice_package "https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/voice.py"
click node_constants "https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/const.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_setup_entry,node_config_flow,node_panel,node_panel_api,node_constants,node_browser toneBlue
class node_pair_callback,node_profile_model,node_profile_store toneAmber
class node_manager,node_tcp_client,node_wol,node_buttons,node_sensors,node_binary_sensor toneMint
class node_voice_controller,node_voice_package toneRose
class node_admin,node_windows,node_ha,node_yandex toneIndigo
```

## Components

### Integration setup

- [Integration entry](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/__init__.py): `custom_components/pc_remote/__init__.py`
- [Config flow](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/config_flow.py): `custom_components/pc_remote/config_flow.py`
- [Management panel](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/www/panel.js): `custom_components/pc_remote/www/panel.js`
- [Panel API](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/http.py): `custom_components/pc_remote/http.py`
- [Integration constants](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/const.py): `custom_components/pc_remote/const.py`

### Pairing and profiles

- [Pairing callback](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/http.py): `custom_components/pc_remote/http.py`
- [Profile validation](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/models.py): `custom_components/pc_remote/models.py`
- [Profile store](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/storage.py): `custom_components/pc_remote/storage.py`

### PC control

- [Command manager](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/manager.py): `custom_components/pc_remote/manager.py`
- [Secure TCP client](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/client.py): `custom_components/pc_remote/client.py`
- [Wake-on-LAN](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/manager.py): `custom_components/pc_remote/manager.py`
- [Command buttons](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/button.py): `custom_components/pc_remote/button.py`
- [Status entities](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/sensor.py): `custom_components/pc_remote/sensor.py`
- [Connection entity](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/binary_sensor.py): `custom_components/pc_remote/binary_sensor.py`

### Voice control

- [Voice controller](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/voice.py): `custom_components/pc_remote/voice.py`
- [Voice package](https://github.com/roxy228/pc-remote-net-plugin-home-assistant/blob/main/custom_components/pc_remote/voice.py): `custom_components/pc_remote/voice.py`

### Other components

- **HA administrator**
- **Pairing browser**
- **Windows PC**
- **Home Assistant**
- **Yandex Intents**

## Connections

- HA administrator → Config flow: configures (evidence: `custom_components/pc_remote/config_flow.py`)
- Config flow → Integration entry: creates entry (evidence: `custom_components/pc_remote/__init__.py`)
- Integration entry → Profile store: loads (evidence: `custom_components/pc_remote/__init__.py`)
- Integration entry → Command manager: creates (evidence: `custom_components/pc_remote/__init__.py`)
- Integration entry → Voice controller: creates (evidence: `custom_components/pc_remote/__init__.py`)
- Integration entry → Panel API: registers (evidence: `custom_components/pc_remote/__init__.py`)
- Integration entry → Management panel: serves (evidence: `custom_components/pc_remote/__init__.py`)
- HA administrator → Management panel: manages PCs (evidence: `README.md`)
- Management panel → Panel API: requests actions (evidence: `README.md`)
- Pairing browser → Pairing callback: completes pairing (evidence: `README.md`)
- Windows PC → Pairing callback: sends credentials
- Pairing callback → Profile validation: validates profile (evidence: `custom_components/pc_remote/models.py`)
- Pairing callback → Profile store: saves profile
- Profile store → Profile validation: loads profiles (evidence: `custom_components/pc_remote/storage.py`)
- Panel API → Profile store: reads and updates (evidence: `custom_components/pc_remote/http.py`)
- Panel API → Command manager: executes commands (evidence: `custom_components/pc_remote/http.py`)
- Command manager → Profile store: gets and saves (evidence: `custom_components/pc_remote/manager.py`)
- Command manager → Secure TCP client: sends command (evidence: `custom_components/pc_remote/manager.py`)
- Secure TCP client → Windows PC: sends encrypted TCP (evidence: `README.md`)
- Command manager → Wake-on-LAN: dispatches wake (evidence: `custom_components/pc_remote/manager.py`)
- Wake-on-LAN → Home Assistant: calls WOL service (evidence: `custom_components/pc_remote/manager.py`)
- Command buttons → Command manager: executes action (evidence: `custom_components/pc_remote/button.py`)
- Status entities → Profile store: reads state (evidence: `custom_components/pc_remote/sensor.py`)
- Connection entity → Profile store: reads state (evidence: `custom_components/pc_remote/binary_sensor.py`)
- Integration entry → Command buttons: sets up platforms (evidence: `custom_components/pc_remote/__init__.py`)
- Integration entry → Status entities: sets up platforms (evidence: `custom_components/pc_remote/__init__.py`)
- Integration entry → Connection entity: sets up platforms (evidence: `custom_components/pc_remote/__init__.py`)
- Integration entry → Voice controller: registers voice actions (evidence: `custom_components/pc_remote/__init__.py`)
- Panel API → Voice controller: configures and applies (evidence: `custom_components/pc_remote/http.py`)
- Voice controller → Voice package: generates package (evidence: `README.md`)
- Voice package → Yandex Intents: provides intents (evidence: `README.md`)
- Yandex Intents → Integration entry: invokes voice actions (evidence: `README.md`)
- Voice controller → Command manager: executes confirmed action (evidence: `custom_components/pc_remote/voice.py`)
- Voice controller → Profile store: reads settings (evidence: `custom_components/pc_remote/voice.py`)
