Skip to content

Beta version - #3

Merged
MattXcz merged 4 commits into
mainfrom
improvment
Sep 23, 2026
Merged

MattXcz merged 4 commits into
mainfrom
improvment

Conversation

@MattXcz

@MattXcz MattXcz commented Sep 23, 2026

Copy link
Copy Markdown
Owner

No description provided.

feat: enforce valid project IDs and improve project file handling

test: add HTTP-level regression tests for API endpoints

feat: implement dynamic default emission for certain fields

fix: ensure YAML generation with Jinja is valid

fix: enhance error handling in API requests

style: improve accessibility with aria-labels and visual feedback

style: add warning display for code generation issues

fix: prevent nesting of repeat groups in layer management

chore: update development dependencies and Docker configurations
- Introduced `rotate`, `dither`, and `ttl` fields in the Project model to allow customization of display options.
- Updated the HA push endpoint to include these new fields in the payload.
- Enhanced the frontend to support user input for these options in the push modal.
- Implemented validation for the new fields in both the backend and frontend.
- Added corresponding tests to ensure the correct functionality of the new features.
- Improved the rendering logic to accommodate the new properties in the canvas and inspector.
- Implemented `render_template` method in `HomeAssistantClient` to render Jinja templates via Home Assistant API.
- Added `/api/validate` endpoint to validate generated templates against live entity state or fallback to local sandbox.
- Created `templating.py` module for rendering and validating templates, including error handling and reporting.
- Updated `ha_push` endpoint to render templates before sending to Home Assistant, ensuring payload is a valid list.
- Added tests for validation and rendering functionalities, ensuring proper error handling and response formats.
- Enhanced frontend with a validation button and status display for template validation results.
- Updated CSS for new status display elements.
- Introduced `test_render.py` for testing the pixel preview renderer.
- Implemented `fetch_assets.py` script to download required font assets.
- Added pixel preview functionality in the frontend, including a new button and modal for rendering previews.
- Updated CSS styles for the preview interface.
- Enhanced color resolution logic in `theme.js` for consistent color handling.
- Updated dependencies in `requirements.txt` and `requirements-dev.txt` for testing and linting tools.
- Added `ruff.toml` for consistent linting configuration.
- Refactored geometry calculations to utilize shared constants for text sizing.
- Improved error handling and reporting for rendering issues.
@MattXcz
MattXcz merged commit a32a8a1 into main Sep 23, 2026
6 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ea3f9bb233

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread backend/app/main.py
Comment on lines 386 to +387
domain, service_name = service.split(".", 1)
if domain.lower() not in ALLOWED_SERVICE_DOMAINS:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject path separators in the service name

When a caller supplies service="open_epaper_link.drawcustom/../../homeassistant/stop", the allowlist accepts the open_epaper_link domain because only the first dot is split, but service_name retains the dot segments and is interpolated into the REST path. HTTP URL normalization then targets /api/services/homeassistant/stop, allowing an unauthenticated editor client to invoke arbitrary Home Assistant services with the stored token despite ALLOWED_SERVICE_DOMAINS. Validate both domain and service name as path-segment identifiers (and reject /, ?, and #) before calling the client.

Useful? React with 👍 / 👎.

Comment on lines +129 to +130
x_start = int(element["x_start"])
y_start = int(element["y_start"])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve pattern coordinates before converting them

A rectangle pattern with a supported percentage position such as x_start: "50%" reaches this handler after template rendering, but int("50%") raises ValueError, so /api/preview reports the valid element as broken instead of rendering it. Use ctx.coords.x() / ctx.coords.y() for these position fields (and the appropriate dimension resolver for size/offset fields) as the other shape handlers do.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant