Repository navigation
Colour fields with paste + full palette, and an off-peak grid colour - #77
Open
cerealkiller57540 wants to merge 1 commit into
Open
cerealkiller57540 wants to merge 1 commit into
cerealkiller57540 wants to merge 1 commit into
Conversation
Editor: - Colour fields use a small custom selector (ha-selector-cpc_color): a text field where any CSS colour can be typed or pasted (#ffea07, a theme colour name like teal, var(--x), rgba(...)), next to a swatch that opens the browser's full colour picker (saved as hex). Emptying the field removes the key so the default colour applies again. - Theme colour names are resolved to var(--<name>-color) in the card, so they work for line, icon, text, label and source colours. Grid off-peak colour: - New grid options offpeak_entity, offpeak_state (default "on", list or comma-separated, case-insensitive) and offpeak_color. While the entity is in an off-peak state, the grid uses offpeak_color for icon, value, lines and the home gradient. README documents both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #61 (colour options for the grid). This PR does not close it: #61 asks for a colour based on import/export, this one switches the grid colour on a tariff.
Editor: colour fields
The colour fields were plain text boxes. They now use a small custom selector,
ha-selector-cpc_color, defined by the card. Mushroom does the same withmush_color.#ffea07, a theme colour name (teal,primary…),var(--my-color),rgba(...). Existing YAML values are shown as they are and left untouched.I tried HA's built-in
ui_colorandcolor_rgbselectors first.ui_coloronly offers about 25 theme colours.color_rgbhas no text field, so you can't paste a hex value, and it stores[r, g, b]arrays.In the card, theme colour names now resolve to
var(--<name>-color)through_resolveColor. That covers line, icon, text, label and source colours.[r, g, b]arrays are also accepted.Grid: off-peak colour
Three new optional grid keys:
offpeak_entitybinary_sensor,input_boolean,schedule, or a tariff sensoroffpeak_stateonoffpeak_colorcolorWhile off-peak is active, the grid uses
offpeak_colorfor the icon, value, lines and home gradient. All three keys are in the visual editor under Grid › Off-peak Colour.offpeak_entityis added to the watched entities, so the card updates when the tariff changes.Testing
offpeak_colorwhen the off-peak entity is in a matching state, including an emptyoffpeak_statewith anonentity.The README documents both features.
🤖 Generated with Claude Code