# arbeaman/octoprint-enclosureheatercontrol architecture

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

- Interactive diagram: https://gitdiagram.com/arbeaman/octoprint-enclosureheatercontrol
- Repository: https://github.com/arbeaman/octoprint-enclosureheatercontrol

## Overview

OctoPrint Enclosure Heater Control provides manual and automatic remote control of a printer enclosure heater. Users toggle it from the navbar, use the plugin API or CLI, or configure G-code triggers and idle timeout behavior; the plugin selects switching and sensing methods and publishes heater state back to clients. The README also documents GPIO, system-command, G-code, and sub-plugin integrations. The main implementation excerpt is partial, so edges are limited to relationships shown there or stated in the README.

Main entry points: [`octoprint_enclosureheatercontrol/__init__.py`](https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/__init__.py) (Plugin controller), [`octoprint_enclosureheatercontrol/static/js/enclosureheatercontrol.js`](https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/static/js/enclosureheatercontrol.js) (Navbar controls), [`extra/enclosureheatercontrol_subpluginexample.py`](https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/extra/enclosureheatercontrol_subpluginexample.py) (Sub-plugin example), [`octoprint_enclosureheatercontrol/cli.py`](https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/cli.py) (CLI commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["User controls"]
  node_navbar["Navbar controls"]
  node_settings["Settings UI"]
  node_cli["CLI commands<br/>[cli.py]"]
end

subgraph group_control["Automation and state"]
  node_plugin["Plugin controller<br/>[__init__.py]"]
  node_triggers["G-code triggers<br/>[__init__.py]"]
  node_idle["Idle timeout<br/>[__init__.py]"]
  node_sensing["State sensing<br/>[__init__.py]"]
  node_state["Heater state<br/>[__init__.py]"]
end

subgraph group_integration["Heater integrations"]
  node_gcode["G-code commands"]
  node_system["System commands"]
  node_gpio["GPIO pins"]
  node_subplugin["Sub-plugin example"]
end

node_user(("OctoPrint user"))
node_octoprint["OctoPrint API"]
node_printer["Printer"]

node_user -->|"uses"| node_navbar
node_navbar -->|"sends API commands"| node_octoprint
node_navbar -->|"fetches state"| node_plugin
node_user -->|"configures"| node_settings
node_cli -->|"posts commands"| node_octoprint
node_octoprint -.->|"routes plugin API"| node_plugin
node_plugin -->|"pushes state"| node_navbar
node_printer -.->|"sends G-code"| node_triggers
node_triggers -.->|"turns heater on"| node_plugin
node_idle -.->|"turns heater off"| node_plugin
node_plugin -->|"starts timer"| node_idle
node_plugin -->|"polls state"| node_sensing
node_sensing -->|"reads pin"| node_gpio
node_sensing -->|"updates"| node_state
node_plugin -.->|"switches via"| node_gcode
node_plugin -.->|"switches via"| node_system
node_plugin -.->|"switches via"| node_gpio
node_plugin -.->|"registers integration"| node_subplugin
node_subplugin -->|"registers at startup"| node_plugin

click node_navbar "https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/static/js/enclosureheatercontrol.js"
click node_settings "https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/static/js/enclosureheatercontrol.js"
click node_cli "https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/cli.py"
click node_plugin "https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/__init__.py"
click node_triggers "https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/__init__.py"
click node_idle "https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/__init__.py"
click node_sensing "https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/__init__.py"
click node_state "https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/__init__.py"
click node_subplugin "https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/extra/enclosureheatercontrol_subpluginexample.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_navbar,node_settings,node_cli,node_user toneBlue
class node_plugin,node_triggers,node_idle,node_sensing,node_state toneAmber
class node_gcode,node_system,node_gpio,node_subplugin,node_octoprint toneMint
class node_printer toneIndigo
```

## Components

### User controls

- [Navbar controls](https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/static/js/enclosureheatercontrol.js): `octoprint_enclosureheatercontrol/static/js/enclosureheatercontrol.js`
- [Settings UI](https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/static/js/enclosureheatercontrol.js): `octoprint_enclosureheatercontrol/static/js/enclosureheatercontrol.js`
- [CLI commands](https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/cli.py): `octoprint_enclosureheatercontrol/cli.py`

### Automation and state

- [Plugin controller](https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/__init__.py): `octoprint_enclosureheatercontrol/__init__.py`
- [G-code triggers](https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/__init__.py): `octoprint_enclosureheatercontrol/__init__.py`
- [Idle timeout](https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/__init__.py): `octoprint_enclosureheatercontrol/__init__.py`
- [State sensing](https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/__init__.py): `octoprint_enclosureheatercontrol/__init__.py`
- [Heater state](https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/octoprint_enclosureheatercontrol/__init__.py): `octoprint_enclosureheatercontrol/__init__.py`

### Heater integrations

- **G-code commands**
- **System commands**
- **GPIO pins**
- [Sub-plugin example](https://github.com/arbeaman/octoprint-enclosureheatercontrol/blob/master/extra/enclosureheatercontrol_subpluginexample.py): `extra/enclosureheatercontrol_subpluginexample.py`

### Other components

- **OctoPrint user**
- **OctoPrint API**
- **Printer**

## Connections

- OctoPrint user → Navbar controls: uses (evidence: `README.md`)
- Navbar controls → OctoPrint API: sends API commands (evidence: `octoprint_enclosureheatercontrol/static/js/enclosureheatercontrol.js`)
- Navbar controls → Plugin controller: fetches state (evidence: `octoprint_enclosureheatercontrol/static/js/enclosureheatercontrol.js`)
- OctoPrint user → Settings UI: configures (evidence: `README.md`)
- CLI commands → OctoPrint API: posts commands (evidence: `octoprint_enclosureheatercontrol/cli.py`)
- OctoPrint API → Plugin controller: routes plugin API
- Plugin controller → Navbar controls: pushes state (evidence: `octoprint_enclosureheatercontrol/__init__.py`)
- Printer → G-code triggers: sends G-code (evidence: `README.md`)
- G-code triggers → Plugin controller: turns heater on (evidence: `README.md`)
- Idle timeout → Plugin controller: turns heater off (evidence: `README.md`)
- Plugin controller → Idle timeout: starts timer (evidence: `octoprint_enclosureheatercontrol/__init__.py`)
- Plugin controller → State sensing: polls state (evidence: `octoprint_enclosureheatercontrol/__init__.py`)
- State sensing → GPIO pins: reads pin (evidence: `octoprint_enclosureheatercontrol/__init__.py`)
- State sensing → Heater state: updates (evidence: `octoprint_enclosureheatercontrol/__init__.py`)
- Plugin controller → G-code commands: switches via (evidence: `README.md`)
- Plugin controller → System commands: switches via (evidence: `README.md`)
- Plugin controller → GPIO pins: switches via (evidence: `README.md`)
- Plugin controller → Sub-plugin example: registers integration
- Sub-plugin example → Plugin controller: registers at startup (evidence: `extra/enclosureheatercontrol_subpluginexample.py`)
