# angrycuban13/pshomebridge architecture

> Architecture diagram of the GitHub repository angrycuban13/pshomebridge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/angrycuban13/pshomebridge
- Repository: https://github.com/angrycuban13/pshomebridge

## Overview

PSHomebridge is a PowerShell 7 client module for the Homebridge UI API. Its user-facing workflow is to establish or select a saved connection, then invoke typed commands for Homebridge status, accessories, plugins, diagnostics, or backups. The tree documents those command families and private configuration/security helpers, but the sampled source contains no PowerShell implementation; internal call wiring and persistence details therefore remain unspecified.

Main entry points: [`PSHomebridge/Source/Public/Invoke-HomebridgeApiRequest.ps1`](https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Invoke-HomebridgeApiRequest.ps1) (API request), [`PSHomebridge/Source/Public/Set-PSHomebridgeConnection.ps1`](https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Set-PSHomebridgeConnection.ps1) (Set connection), [`PSHomebridge/Source/Public/Get-PSHomebridgeConnection.ps1`](https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Get-PSHomebridgeConnection.ps1) (Get connection), [`PSHomebridge/Source/Public/Remove-PSHomebridgeConnection.ps1`](https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Remove-PSHomebridgeConnection.ps1) (Remove connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_connections["Connections and security"]
  node_set_connection["Set connection"]
  node_get_connection["Get connection"]
  node_remove_connection["Remove connection"]
  node_configuration["Configuration helpers"]
  node_secret_protection["Secret protection"]
end

subgraph group_api["API access"]
  node_api_request["API request"]
  node_homebridge_api{{"Homebridge UI API"}}
end

subgraph group_resources["Homebridge resources"]
  node_status["Status"]
  node_accessories["Accessories and layout"]
  node_accessory_layout["Accessory layout"]
  node_plugins["Plugin commands"]
  node_diagnostics["Server diagnostics"]
end

subgraph group_backups["Backup management"]
  node_new_backup["Create backup"]
  node_get_backup["Get backup"]
  node_save_backup["Save backup"]
  node_remove_backup["Remove backup"]
end

node_powershell_user(("PowerShell user"))

node_powershell_user -->|"invokes"| node_set_connection
node_powershell_user -->|"invokes"| node_get_connection
node_powershell_user -->|"invokes"| node_remove_connection
node_powershell_user -->|"invokes"| node_api_request
node_powershell_user -->|"invokes"| node_status
node_powershell_user -->|"invokes"| node_accessories
node_powershell_user -->|"invokes"| node_accessory_layout
node_powershell_user -->|"invokes"| node_plugins
node_powershell_user -->|"invokes"| node_diagnostics
node_powershell_user -->|"invokes"| node_new_backup
node_powershell_user -->|"invokes"| node_get_backup
node_powershell_user -->|"invokes"| node_save_backup
node_powershell_user -->|"invokes"| node_remove_backup
node_api_request -->|"requests"| node_homebridge_api

click node_set_connection "https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Set-PSHomebridgeConnection.ps1"
click node_get_connection "https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Get-PSHomebridgeConnection.ps1"
click node_remove_connection "https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Remove-PSHomebridgeConnection.ps1"
click node_configuration "https://github.com/angrycuban13/pshomebridge/tree/main/PSHomebridge/Source/Private"
click node_secret_protection "https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Private/Protect-PSHomebridgeConfigurationSecret.ps1"
click node_api_request "https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Invoke-HomebridgeApiRequest.ps1"
click node_status "https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Get-HomebridgeStatus.ps1"
click node_accessories "https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Get-HomebridgeAccessory.ps1"
click node_accessory_layout "https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Get-HomebridgeAccessoryLayout.ps1"
click node_plugins "https://github.com/angrycuban13/pshomebridge/tree/main/PSHomebridge/Source/Public"
click node_diagnostics "https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Get-HomebridgeServerDiagnostic.ps1"
click node_new_backup "https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/New-HomebridgeBackup.ps1"
click node_get_backup "https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Get-HomebridgeBackup.ps1"
click node_save_backup "https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Save-HomebridgeBackup.ps1"
click node_remove_backup "https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Remove-HomebridgeBackup.ps1"

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_set_connection,node_get_connection,node_remove_connection,node_configuration,node_secret_protection,node_powershell_user toneBlue
class node_api_request,node_homebridge_api toneAmber
class node_status,node_accessories,node_accessory_layout,node_plugins,node_diagnostics toneMint
class node_new_backup,node_get_backup,node_save_backup,node_remove_backup toneRose
```

## Components

### Connections and security

- [Set connection](https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Set-PSHomebridgeConnection.ps1): `PSHomebridge/Source/Public/Set-PSHomebridgeConnection.ps1`
- [Get connection](https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Get-PSHomebridgeConnection.ps1): `PSHomebridge/Source/Public/Get-PSHomebridgeConnection.ps1`
- [Remove connection](https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Remove-PSHomebridgeConnection.ps1): `PSHomebridge/Source/Public/Remove-PSHomebridgeConnection.ps1`
- [Configuration helpers](https://github.com/angrycuban13/pshomebridge/tree/main/PSHomebridge/Source/Private): `PSHomebridge/Source/Private`
- [Secret protection](https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Private/Protect-PSHomebridgeConfigurationSecret.ps1): `PSHomebridge/Source/Private/Protect-PSHomebridgeConfigurationSecret.ps1`

### API access

- [API request](https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Invoke-HomebridgeApiRequest.ps1): `PSHomebridge/Source/Public/Invoke-HomebridgeApiRequest.ps1`
- **Homebridge UI API**

### Homebridge resources

- [Status](https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Get-HomebridgeStatus.ps1): `PSHomebridge/Source/Public/Get-HomebridgeStatus.ps1`
- [Accessories and layout](https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Get-HomebridgeAccessory.ps1): `PSHomebridge/Source/Public/Get-HomebridgeAccessory.ps1`
- [Accessory layout](https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Get-HomebridgeAccessoryLayout.ps1): `PSHomebridge/Source/Public/Get-HomebridgeAccessoryLayout.ps1`
- [Plugin commands](https://github.com/angrycuban13/pshomebridge/tree/main/PSHomebridge/Source/Public): `PSHomebridge/Source/Public`
- [Server diagnostics](https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Get-HomebridgeServerDiagnostic.ps1): `PSHomebridge/Source/Public/Get-HomebridgeServerDiagnostic.ps1`

### Backup management

- [Create backup](https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/New-HomebridgeBackup.ps1): `PSHomebridge/Source/Public/New-HomebridgeBackup.ps1`
- [Get backup](https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Get-HomebridgeBackup.ps1): `PSHomebridge/Source/Public/Get-HomebridgeBackup.ps1`
- [Save backup](https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Save-HomebridgeBackup.ps1): `PSHomebridge/Source/Public/Save-HomebridgeBackup.ps1`
- [Remove backup](https://github.com/angrycuban13/pshomebridge/blob/main/PSHomebridge/Source/Public/Remove-HomebridgeBackup.ps1): `PSHomebridge/Source/Public/Remove-HomebridgeBackup.ps1`

### Other components

- **PowerShell user**

## Connections

- PowerShell user → Set connection: invokes
- PowerShell user → Get connection: invokes
- PowerShell user → Remove connection: invokes
- PowerShell user → API request: invokes
- PowerShell user → Status: invokes
- PowerShell user → Accessories and layout: invokes
- PowerShell user → Accessory layout: invokes
- PowerShell user → Plugin commands: invokes
- PowerShell user → Server diagnostics: invokes
- PowerShell user → Create backup: invokes
- PowerShell user → Get backup: invokes
- PowerShell user → Save backup: invokes
- PowerShell user → Remove backup: invokes
- API request → Homebridge UI API: requests
