Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ the API reference and internals. Keep them in their lanes — don't put REST tab
## Commands

```bash
.venv/bin/python -m pytest -q # 341 tests, no network, no strands
.venv/bin/python -m pytest -q # 342 tests, no network, no strands
.venv/bin/pre-commit run --all-files # Black + Prettier; the git hook runs this on staged files
npm --prefix frontend test # JS pattern port vs Python fixtures
npm --prefix frontend run build # required before the Docker build picks up UI changes
Expand Down
1 change: 1 addition & 0 deletions app/presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def default_presets() -> dict[str, Pattern]:
load with both sliders at the far left.
"""
return {
# Also the editor's starting pattern (STARTING_PATTERN in PatternPage.jsx).
"Halloween": Pattern(
slots=[
Slot(rgbw=ORANGE, weight=80),
Expand Down
15 changes: 15 additions & 0 deletions docs/releases/0.6.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
The pattern editor now starts on Halloween.

## What's changed

- **The editor's starting pattern is the built-in Halloween preset:** deeper orange (80%), purple (15%) and a touch of yellow (5%). It used to start on an older two-color orange and purple that didn't match any preset. You see it when a group has no pattern yet.

## Upgrading

Running Dapple as a Home Assistant app: install the update from Settings → Updates.

With Docker, `docker compose up -d` picks this up if you have `pull_policy: always`. Otherwise run `docker compose pull && docker compose up -d`. Your settings and saved presets carry over. To stay on this release, set the image line to:

```yaml
image: afraley/dapple:0.6.1
```
4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "dapple-ui",
"private": true,
"license": "MIT",
"version": "0.6.0",
"version": "0.6.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/PatternPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ const LIVE_POLL_MS = 5000
/** For a pattern that doesn't say: a preset saved without one, or a new pattern. */
const DEFAULT_BRIGHTNESS = 60

/** The built-in Halloween preset (app/presets.py); keep the two the same. */
const STARTING_PATTERN = {
slots: [
{ rgbw: [255, 152, 0, 0], weight: 80 },
{ rgbw: [128, 0, 255, 0], weight: 20 },
{ rgbw: [255, 126, 0, 0], weight: 80 },
{ rgbw: [128, 0, 255, 0], weight: 15 },
{ rgbw: [255, 236, 0, 0], weight: 5 },
],
layout: 'interleaved',
block_size: 1,
Expand Down
2 changes: 1 addition & 1 deletion home-assistant/dapple/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# The Dapple add-on. The Supervisor pulls afraley/dapple:<version>, the same
# image Docker users run, so `version` must match pyproject.toml (CI checks).
name: Dapple
version: "0.6.0"
version: "0.6.1"
slug: dapple
description: Static multi-color patterns for Twinkly lights
url: https://github.com/andrewfraley/dapple
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "dapple"
version = "0.6.0"
version = "0.6.1"
description = "Static multi-color patterns for Twinkly light strands, with a REST API for Home Assistant"
requires-python = ">=3.12"
dependencies = [
Expand Down
15 changes: 15 additions & 0 deletions tests/test_presets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""The preset store: seeding, round-tripping, atomic writes, bad input."""

import json
import re
from pathlib import Path

import pytest

Expand Down Expand Up @@ -184,3 +186,16 @@ def test_built_in_presets_sit_on_the_share_sliders_steps():
for name, pattern in default_presets().items():
for slot in pattern.slots:
assert 5 <= slot.weight <= 100 and slot.weight % 5 == 0, name


def test_the_editor_starts_on_the_halloween_preset():
"""PatternPage.jsx keeps its own copy for before the presets load; it drifted once."""
source = (Path(__file__).parent.parent / "frontend/src/PatternPage.jsx").read_text()
block = re.search(r"const STARTING_PATTERN = \{.*?\n\}", source, re.S).group()
slots = [
(tuple(int(n) for n in rgbw.split(",")), int(weight))
for rgbw, weight in re.findall(r"rgbw: \[([\d, ]+)\], weight: (\d+)", block)
]

halloween = default_presets()["Halloween"]
assert slots == [(slot.rgbw, slot.weight) for slot in halloween.slots]
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading