geekmagic-hacs
AGENTS.md510 starsChanged 15 days agoMITView on GitHub
Home Assistant custom integration for GeekMagic displays (SmallTV Pro and similar ESP8266-based devices). Use uv for all Python operations: Follow Conventional Commits and create atomic commits as you work: Always run pre-commit before committing: uv run pre-commit run --all This validates tests, linting, formatting, and type checking in one command. HACS detects new versions via GitHub releases. When the user asks for a release, Codex does all of it: bump, wait for CI, tag, push, publish the release with GitHub's…
- Installs packages
- Commits and pushes
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,040 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- geekmagic-reverse-engineerSkill
- release-highlightsSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
48 rules. About 0 are common, 14 are distinctive, and 34 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
34
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 7
Use uv for all Python operations:
- Distinctive: line 21
Follow Conventional Commits and create atomic commits as you work:
- Distinctive: line 33
Create small, focused commits that each represent a single logical change:
- Distinctive: line 64
Commit and push on main:
- Very specific: line 68
Wait for CI, HACS and Hassfest to pass on the bump commit (gh run list --branch main, gh run watch <id>).
- Distinctive: line 84
Only release when the user asked for one: a release reaches every HACS user, and a published tag is never moved or reused (fix forward with …
- Distinctive: line 172
Use high contrast colors (light on dark)
- Very specific: line 226
Default: THEME_TEXT_PRIMARY (white).
- Distinctive: line 229
Use a role tint only when one of these narrow exceptions applies:
- Very specific: line 243
Don't hardcode SYSTEM_* in widget code — the regression test tests/test_watchos_design_system.py::TestNoHardcodedSystemColors guards this.
- Very specific: line 246
Don't import directly from widgets/theme.py for colour values.
- Distinctive: line 247
Don't tint a hero value just because it "looks nice" — follow the rule above.
- Very specific: line 249
Don't use Column(justify="center") if the cell is taller than the natural content height — content will cluster centred and waste space.
- Very specific: line 251
Default to justify="space-evenly" for top-to-bottom content distribution: it puts equal spacing before, between, and after the children, …
- Very specific: line 260
Don't use absolute Padding(top=..., bottom=...) for layout when child heights vary with cell size — they only work at the exact tuning …
- Very specific: line 262
Prefer flex-style Column/Row with Spacer.
- Very specific: line 266
Read tests/test_watchos_design_system.py before adding a widget — it documents the contract.
- Very specific: line 268
Use ctx.track_color(tint) for any bar/ring/arc track — picks up the theme's tint_track setting automatically.
- Very specific: line 270
Use ctx.fit_text() for hero values that should auto-scale to fill their box — guarantees the value stays inside its budget.
- Very specific: line 272
Use the BarGauge factory's mode="auto" (default) — it picks compact/stacked/vertical for you.
- Distinctive: line 281
Use these for new widgets - they scale proportionally to container height:
- Very specific: line 330
Prefer semantic sizes (primary, secondary, tertiary) for new code
- Very specific: line 331
Use ctx.fit_text() when text should fill available space
- Very specific: line 332
Add bold=True for values that need emphasis
- Distinctive: line 333
Never specify pixel sizes directly
- Distinctive: line 345
All tests use mocks and don't require a real device or Home Assistant instance.
- Very specific: line 356
Use core interfaces (hass.states, hass.services) instead of integration details
- Distinctive: line 358
Add regression tests when fixing bugs
- Very specific: line 359
Run pytest and pre-commit before commits
- Distinctive: line 387
When that happens the fix belongs on main, not in the contributor's branch.
- Very specific: line 395
Add to WIDGET_CLASSES in coordinator.py
- Very specific: line 396
Add tests in tests/widgets/
- Very specific: line 400
Use helper functions from widgets/helpers.py for common operations:
- Very specific: line 415
Use widgets/layout_helpers.py for common rendering patterns:
- Distinctive: line 429
When adding a new layout, update these files:
- Very specific: line 441
Add entry to layoutConfig object with CSS class and cell count
- Very specific: line 442
Add CSS grid styles for the layout icon visualization in the <style> section
- Very specific: line 443
Run npm run build in frontend/ directory to rebuild
- Very specific: line 448
Run uv run python scripts/update_samples.py to generate images (CI also regenerates them on PRs — see "Samples (README images)")
- Very specific: line 479
When embedding sample/screenshot images of device renders (240x240 PNGs from samples/) in README.md:
- Very specific: line 481
Outside tables: always use width="200" for consistency across Dashboard Samples, Binary Sensor States, Domain Icons, Layout Examples, etc.
- Very specific: line 502
Create implementation in entities/<platform>.py
- Very specific: line 503
Create stub at custom_components/geekmagic/<platform>.py that re-exports async_setup_entry
- Very specific: line 504
Add Platform.<PLATFORM> to PLATFORMS list in __init__.py
- Very specific: line 523
Sleep: Use asyncio.sleep() instead of time.sleep()
- Very specific: line 549
After making changes to the frontend source in custom_components/geekmagic/frontend/:
- Very specific: line 566
Run npm run build to regenerate dist/
- Distinctive: line 567
Commit both source and dist changes
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GeekMagic HACS Integration
Home Assistant custom integration for GeekMagic displays (SmallTV Pro and similar ESP8266-based devices).
Development
Use uv for all Python operations:
uv sync # Install dependencies
uv run pytest # Run tests
uv run pytest -v # Run tests with verbose output
uv run ruff check . # Lint code
uv run ruff format . # Format code
uv run ty check # Type check
uv run pre-commit run --all # Run all pre-commit hooksGit Workflow
Follow Conventional Commits and create atomic commits as you work:
Commit Types
feat:New featurefix:Bug fixrefactor:Code refactoring (no functional change)docs:Documentation onlytest:Adding/updating testschore:Maintenance (deps, config, tooling)style:Formatting, whitespace (no code change)
Atomic Commits
Create small, focused commits that each represent a single logical change:
- After implementing a feature → commit the feature
- After fixing a bug → commit the fix
- After adding tests → commit the tests
- After refactoring → commit the refactor
Always run pre-commit before committing: uv run pre-commit run --all
This validates tests, linting, formatting, and type checking in one command.
Examples
git commit -m "feat: add clock widget with timezone support"
git commit -m "fix: handle missing entity gracefully in EntityWidget"
git commit -m "test: add unit tests for sparkline rendering"
git commit -m "refactor: extract color parsing into helper function"
git commit -m "chore: add ty type checker and pre-commit hooks"Release Process
HACS detects new versions via GitHub releases. When the user asks for a release, Codex does all of it: bump, wait for CI, tag, push, publish the release with GitHub's generated notes. The user doesn't need to touch the GitHub UI.
When the user asks for a release (e.g. "release 1.0.1", "bump and release a patch")
- Determine the new version using semver:
- Patch (
1.0.0 → 1.0.1): bug fixes only - Minor (
1.0.0 → 1.1.0): new features, backward-compatible - Major (
1.0.0 → 2.0.0): breaking changes
- Patch (
- On an up-to-date
main(git pull --ff-only), updateversionincustom_components/geekmagic/manifest.json - Commit and push on
main:chore: bump version to X.Y.Z - Wait for CI, HACS and Hassfest to pass on the bump commit (
gh run list --branch main,gh run watch <id>). If one fails, stop and report: never tag a red commit. - Tag the bump commit and push the tag:
git tag -s X.Y.Z <bump-sha> -m "X.Y.Z" # annotated tag without -s if signing fails git push origin X.Y.Z - Publish the release from that tag:
gh release create X.Y.Z --verify-tag --generate-notes --title X.Y.Z - Report the release URL and what it contains (the generated notes' PR list).
Critical rules
- Tag must match
manifest.jsonversion exactly (HA core readsmanifest.jsonand a mismatch breaks update detection): checkgit show <bump-sha>:custom_components/geekmagic/manifest.jsonbefore tagging - Tag the bump commit, not an earlier one — otherwise the tagged tree still has the old version
- Tag format:
X.Y.Z(no leadingv— every existing tag is plain, e.g.1.5.1) - Only release when the user asked for one: a release reaches every HACS user, and a published tag is never moved or reused (fix forward with a new patch version)
Project Structure
custom_components/geekmagic/
├── __init__.py # Integration entry, services
├── config_flow.py # Device setup + options flow
├── coordinator.py # Data update coordinator
├── device.py # HTTP API client for GeekMagic
├── renderer.py # Pillow image generation
├── const.py # Constants and config keys
├── widgets/ # Widget components
│ ├── base.py # Widget base class
│ ├── clock.py # Clock widget
│ ├── entity.py # HA entity display
│ ├── media.py # Media player widget
│ ├── chart.py # Sparkline chart
│ ├── helpers.py # Widget helper functions
│ └── text.py # Static/dynamic text
├── layouts/ # Layout systems
│ ├── base.py # Layout base class
│ ├── grid.py # 2x2, 2x3, 3x3 grids
│ ├── hero.py # Hero + footer layout
│ └── split.py # Split panel layouts
├── entities/ # Entity platform implementations
│ ├── entity.py # Base GeekMagicEntity class
│ ├── number.py # Number entities (brightness, etc.)
│ ├── select.py # Select entities (layout, widget type)
│ ├── switch.py # Switch entities (boolean options)
│ ├── text.py # Text entities (names, labels)
│ ├── button.py # Button entities (refresh, nav)
│ └── sensor.py # Sensor entities (status, dividers)
├── number.py # Re-export for HA platform discovery
├── select.py # Re-export for HA platform discovery
├── switch.py # Re-export for HA platform discovery
├── text.py # Re-export for HA platform discovery
├── button.py # Re-export for HA platform discovery
├── sensor.py # Re-export for HA platform discovery
├── manifest.json # HACS metadata
└── strings.json # UI translationsKey Concepts
Rendering Pipeline
- Coordinator triggers update on interval
- Layout calculates widget rectangles (slots)
- Each widget renders into its slot using Pillow
- Image converted to JPEG and uploaded to device
Widget Interface
class Widget(ABC):
def render(self, ctx: RenderContext, hass) -> None:
"""Draw widget using the render context (local coordinates)."""
def get_entities(self) -> list[str]:
"""Return entity IDs this widget depends on."""Layout Interface
class Layout(ABC):
def _calculate_slots(self) -> None:
"""Calculate slot rectangles."""
def render(self, renderer, draw, hass) -> None:
"""Render all widgets in their slots."""Device API
GeekMagic devices use a simple HTTP API:
POST /doUpload?dir=/image/ # Upload image (multipart form)
GET /set?img=/image/{file} # Display image
GET /set?theme=3 # Set custom image mode
GET /set?brt={0-100} # Set brightness
GET /app.json # Get device stateDisplay Constraints
- Resolution: 240x240 pixels
- Physical size: ~4cm diagonal
- Minimum font size: 10-12px for readability
- Use high contrast colors (light on dark)
- JPEG upload is faster than PNG (~2.5s vs ~5.8s)
Design System (watchOS-inspired) — rules for widget authors
The default theme (watchos) is modelled on Apple's watchOS HIG: true-black
background, system colours, opacity-based text hierarchy, tinted Activity-ring
gauges, no card chrome. Every widget should follow these rules so themes
stay consistent. When in doubt, look at how Entity / Clock / BarGauge
handle the same thing — they're the canonical references.
Goals
- Information density first. A 240×240 cell is tiny. Use every pixel —
justify="space-evenly"to spread content top-to-bottom (equal gaps before/between/after each band reads more balanced than pinning the first/last items flush to the cell edges). Never leave the bottom half of a cell empty if there's data to show. Three-band layout (caption / hero / supporting strip) is the default for cells ≥100×100. - Hierarchy via size + weight + colour. A glance must surface the primary metric instantly: bold + large for the hero, secondary for supporting data, tertiary for captions. Don't make everything the same size.
- Theme consistency. A user moving between widgets in the same theme should never see an unexplained colour shift. Colour comes from the theme, not from the widget.
- Adapt to cell shape. Pick layout from
(width, height)at render time — a hero ring should spread across a fullscreen cell but stay tight in a 3×3 grid; a vertical bar should stack everything when the cell is very narrow.
Colour rules — pick by intent, not by RGB
Widgets MUST use theme role sentinels from widgets/components.py,
never hardcoded SYSTEM_BLUE/SYSTEM_ORANGE/etc. The sentinels resolve
to the active theme's palette at render time.
Available sentinels (resolve to theme.<role>):
| Sentinel | Use for |
THEME_TEXT_PRIMARY | Default for hero values (white-ish on dark themes) |
THEME_TEXT_SECONDARY | Supporting info (dates, units, "Sunny" condition) |
THEME_TEXT_TERTIARY | Caps captions, very-low-priority text |
THEME_PRIMARY | Brand accent — fallback for chart / progress |
THEME_SECONDARY | Night, lightning, less-prominent accents |
THEME_SUCCESS | ON / connected / wind |
THEME_WARNING | Sunny / hot temp / heating / caution |
THEME_ERROR | Off / disconnected / extreme / preheating |
THEME_INFO | Cool / cold / water / rain / cooling / humidity |
THEME_MUTED | Idle / off / fog / disabled |
Rule of thumb for hero value colour:
- Default:
THEME_TEXT_PRIMARY(white). Use this for entity value, clock time, weather temp, climate temp, multi-progress hero, bar-gauge compact value. - Use a role tint only when one of these narrow exceptions applies:
- Gauge family (Bar/Ring/Arc) where the value matches the gauge's
own accent — value + fill read as one visual unit (Apple Activity-ring
style). E.g. ring
73%in the ring's tint. - Status state where the colour IS the meaning —
ONin success green,OFFin error red. - Mode chip where the tint reinforces an explicit mode label
(climate
HEATINGchip in warning).
- Gauge family (Bar/Ring/Arc) where the value matches the gauge's
own accent — value + fill read as one visual unit (Apple Activity-ring
style). E.g. ring
The icon, ring fill, bar fill, and dot indicators carry the semantic tint. That's where the colour lives.
Don't
- Don't hardcode
SYSTEM_*in widget code — the regression testtests/test_watchos_design_system.py::TestNoHardcodedSystemColorsguards this. - Don't
importdirectly fromwidgets/theme.pyfor colour values. - Don't tint a hero value just because it "looks nice" — follow the rule above. If you're tempted, the icon should probably be tinted instead.
- Don't use
Column(justify="center")if the cell is taller than the natural content height — content will cluster centred and waste space. Default tojustify="space-evenly"for top-to-bottom content distribution: it puts equal spacing before, between, and after the children, which reads better in most cells thanspace-between(which pins the first/last children flush to the edges and can leave them feeling crowded). Only fall back tospace-betweenwhen the cell is so short that any breathing room would push content off screen, or when you specifically want the first/last items hard against the cell edge. For Rows (horizontal),space-betweenis still the right call (label left / value right pattern). - Don't use absolute
Padding(top=..., bottom=...)for layout when child heights vary with cell size — they only work at the exact tuning point. Prefer flex-style Column/Row withSpacer.
Do
- Read
tests/test_watchos_design_system.pybefore adding a widget — it documents the contract. - Use
ctx.track_color(tint)for any bar/ring/arc track — picks up the theme'stint_tracksetting automatically. - Use
ctx.fit_text()for hero values that should auto-scale to fill their box — guarantees the value stays inside its budget. - Use the
BarGaugefactory'smode="auto"(default) — it picks compact/stacked/vertical for you.
Font Sizing System
Fonts are automatically scaled based on container height. Two naming systems are supported:
Semantic Sizes (Preferred)
Use these for new widgets - they scale proportionally to container height:
| Size | Ratio | Use Case |
primary | 35% | Main value (clock time, large number) |
secondary | 20% | Supporting info (date, unit) |
tertiary | 12% | Labels, captions |
# Get font with semantic size
font = ctx.get_font("primary", bold=True)
font = ctx.get_font("secondary")
font = ctx.get_font("tertiary", adjust=-1) # Slightly smallerAuto-Fit Text
For text that should fill available space (like clock displays):
# Get largest font that fits within bounds
font = ctx.fit_text("12:45", max_width=ctx.width * 0.95)
font = ctx.fit_text("Hello", max_width=100, max_height=50, bold=True)Relative Adjustments
Fine-tune sizes with adjust parameter (-2 to +2, each step is ~15%):
font = ctx.get_font("secondary", adjust=+1) # 15% larger
font = ctx.get_font("primary", adjust=-1) # 15% smallerLegacy Sizes
Still supported for backward compatibility:
| Size Name | Use Case |
tiny | Small labels |
small | Labels, status |
regular | Standard text |
medium | Emphasized values |
large | Primary values |
xlarge | Hero values |
huge | Maximum emphasis |
Best practices:
- Prefer semantic sizes (
primary,secondary,tertiary) for new code - Use
ctx.fit_text()when text should fill available space - Add
bold=Truefor values that need emphasis - Never specify pixel sizes directly
Testing
Tests are organized by component:
tests/test_device.py- HTTP client teststests/test_renderer.py- Pillow rendering teststests/test_config_flow.py- Config flow and options flow teststests/test_integration.py- Integration setup/teardown teststests/widgets/test_widgets.py- Widget teststests/layouts/test_layouts.py- Layout tests
All tests use mocks and don't require a real device or Home Assistant instance.
Home Assistant Testing Best Practices
Uses pytest-homeassistant-custom-component for HA-specific fixtures. See:
- https://github.com/MatthewFlamm/pytest-homeassistant-custom-component
- https://developers.home-assistant.io/docs/development_testing/
Available fixtures: hass, aioclient_mock, MockConfigEntry, etc.
Testing principles:
- Use core interfaces (
hass.states,hass.services) instead of integration details - Mock external dependencies (
aiohttp, devices) - Add regression tests when fixing bugs
- Run
pytestandpre-commitbefore commits - Never reach into
hass.databy string key, and never call a core API the release notes mark deprecated. Both work right up until they don't: HA'shass.datakeys areHassKeyobjects that only happen to subclassstr, so a raw lookup returnsNoneand silently drops data instead of raising.dr.async_get(hass)/ar.async_get(hass)/er.async_get(hass), anddr.async_entries_for_config_entryoverasync_get_device.
The CI matrix is an HA matrix
uv.lock is gitignored on purpose, so CI resolves fresh on every run. Each
pytest-homeassistant-custom-component release pins one exact HA version
and raises its own requires-python in lockstep, which means the Python
version alone decides which core the suite runs against:
| Job | Resolves to | As of 2026-09 |
| Python 3.12 | oldest ptc that still supports it | HA 2025.1.4 |
| Python 3.13 | a ptc a few months back | HA 2026.2.3 (stable) |
| Python 3.14 | the newest ptc | HA 2026.9.0b6 (beta) |
That mapping moves on its own. The Resolved Home Assistant version step in
each leg prints what a given run actually got.
The newest leg is deliberately merge-blocking. Resolving unpinned is how
the 2026.9 deprecation of device_registry.async_get_device surfaced months
before it would have reached users, and a red check is what got it fixed the
same day. The accepted cost: an upstream beta can turn an unrelated PR red.
When that happens the fix belongs on main, not in the contributor's branch.
Adding New Widgets
- Create
custom_components/geekmagic/widgets/mywidget.py - Extend
Widgetbase class - Implement
render()and optionallyget_entities() - Register in
widgets/__init__.py - Add to
WIDGET_CLASSESincoordinator.py - Add tests in
tests/widgets/
Widget Helper Functions
Use helper functions from widgets/helpers.py for common operations:
from ..widgets.helpers import (
truncate_text, # Truncate long text with ellipsis
extract_numeric, # Get float from entity state
resolve_label, # Get label from config or friendly_name
calculate_percent, # Calculate percentage in range
is_entity_on, # Check binary state
get_unit, # Get unit of measurement
)Layout Helper Functions
Use widgets/layout_helpers.py for common rendering patterns:
from ..widgets.layout_helpers import (
layout_icon_label_value, # [Icon] [Label] ... [Value]
layout_centered_value, # Centered value with label below
layout_bar_with_label, # Progress bar with label/value above
layout_list_rows, # Calculate row positions for lists
draw_title, # Draw title at top
)Adding New Layouts
When adding a new layout, update these files:
1. Backend
layouts/<name>.py- Create layout class extendingLayoutlayouts/__init__.py- Import and export the new classconst.py- AddLAYOUT_<NAME>constant and add toLAYOUT_SLOT_COUNTScoordinator.py- Add toLAYOUT_CLASSESdict
2. Frontend
frontend/src/geekmagic-panel.ts:- Add entry to
layoutConfigobject with CSS class and cell count - Add CSS grid styles for the layout icon visualization in the
<style>section
- Add entry to
- Run
npm run buildinfrontend/directory to rebuild
3. Documentation & Samples
scripts/generate_samples.py- Add layout togenerate_layout_samples()- Run
uv run python scripts/update_samples.pyto generate images (CI also regenerates them on PRs — see "Samples (README images)") README.md- Add to "Layout Examples" section and "Layout Types" table
4. Tests
tests/layouts/test_layouts.py- Add test class for the new layout
Samples (README images)
samples/ holds the README's rendered device images. Regenerate them with
one command:
uv run python scripts/update_samples.pyIt runs scripts/generate_samples.py and scripts/generate_html_samples.py,
then deletes any file under samples/ that no generator produced (so never
hand-place images there — add a generator instead). A file is only rewritten
when its pixels change by more than NOISE_TOLERANCE (scripts/sample_io.py),
so macOS and Linux renders don't fight over rounding noise.
CI keeps them current (.github/workflows/samples.yml): on a same-repo PR it
regenerates samples on Linux and, if anything changed, pushes a
chore: regenerate samples commit to your branch — so after pushing, you may
need git pull --rebase before your next push. Fork PRs can't receive that
push: the check fails and tells you to run the command above and commit.
README Image Conventions
When embedding sample/screenshot images of device renders (240x240 PNGs from samples/) in README.md:
- Outside tables: always use
width="200"for consistency across Dashboard Samples, Binary Sensor States, Domain Icons, Layout Examples, etc. - Inside tables: omit the
widthattribute — let the table column dictate sizing. - UI screenshots (panel editor, device info pages) and the hero device photo are not "samples" and keep their own widths.
Home Assistant Platform Discovery
IMPORTANT: Home Assistant discovers entity platforms by looking for modules at custom_components.<domain>.<platform>. For example, Platform.NUMBER looks for custom_components.geekmagic.number.
Entity implementations live in entities/ subfolder for organization, but stub modules must exist at the root level that re-export async_setup_entry:
# custom_components/geekmagic/number.py (stub for HA discovery)
"""Number platform - re-exports from entities submodule."""
from .entities.number import async_setup_entry
__all__ = ["async_setup_entry"]When Adding New Entity Platforms
- Create implementation in
entities/<platform>.py - Create stub at
custom_components/geekmagic/<platform>.pythat re-exportsasync_setup_entry - Add
Platform.<PLATFORM>toPLATFORMSlist in__init__.py
Common Mistake to Avoid
Moving entity files to a subfolder without creating re-export stubs will cause:
ModuleNotFoundError: No module named 'custom_components.geekmagic.<platform>'The fix is to create stub modules that re-export from the subfolder.
Asyncio and Blocking Operations
Home Assistant runs on asyncio. Blocking operations prevent the event loop from executing other tasks and must be handled properly.
Blocking Operations to Avoid in Async Code
- Disk I/O:
open(),glob.glob(),os.walk(),os.listdir(),pathlibread/write - Network I/O: urllib operations (use
aiohttpinstead) - Heavy computation: CPU-intensive tasks like image rendering
- Sleep: Use
asyncio.sleep()instead oftime.sleep()
How to Offload Blocking Work
# In Home Assistant integration code:
result = await hass.async_add_executor_job(blocking_function, arg1, arg2)
# With keyword arguments:
from functools import partial
result = await hass.async_add_executor_job(partial(blocking_function, kwarg1=value1), arg1)This Integration's Blocking Operations
- Image rendering (Pillow): CPU-intensive, runs in executor
- JPEG/PNG encoding: CPU-intensive, runs in executor
- HTTP upload to device: Uses aiohttp (async-native)
See: https://developers.home-assistant.io/docs/asyncio_blocking_operations/
Frontend Panel
The integration includes a custom panel for configuring displays via the HA sidebar.
Building the Frontend
After making changes to the frontend source in custom_components/geekmagic/frontend/:
cd custom_components/geekmagic/frontend
npm install # First time only
npm run build # Build production bundleImportant: The built dist/ directory must be committed to git. Users install via HACS which clones the repo directly - there's no build step during installation.
Cache Busting
The panel uses content-hash based cache busting. A SHA256 hash of the JS file is appended to the URL (via ?h={hash} query parameter). When the file content changes, the hash changes, and browsers automatically fetch the new version.
After Frontend Changes
- Make changes in
frontend/src/ - Run
npm run buildto regeneratedist/ - Commit both source and dist changes
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

