Show and control cooling on the controller card - #2
Open
thorwaler wants to merge 2 commits into
Open
Conversation
Recognises hvac_action/hvac_mode of cooling/cool from the integration's cool_mode: - add a 'cooling' status string (en: Cooling, de: Kuehlbetrieb; others fall back to en) - status label returns status.cooling for cooling/cool - status icon shows a blue snowflake (mdi:snowflake) instead of the radiator - dial 'on' visual lights for hvac === 'cool' as well as 'heat' NOTE: edited in the built bundle for reference; the change should be made in the card source and rebuilt.
Adds a 'Heat / Cool' action button (data-action=heat-cool-toggle) that calls climate.set_hvac_mode on the controller's climate entity, flipping between heat and cool. Mirrors the existing maintenance set_hvac_mode pattern; the dial already reflects the resulting mode (blue + snowflake).
Author
|
Companion backend PR: lweberru/pool_controller#5 — adds the cool hvac_mode this card reflects. Merge/port that first, since the card only shows cooling once the integration reports hvac_action: cooling. |
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.
Companion to the integration cooling PR
(thorwaler/pool_controller_coolingmode). With the integration reporting
hvac_mode: cool/hvac_action: cooling, the card currently mislabels cooling asIdle, lights the dial heating-red, and shows radiator glyphs. This adds cooling
display and an on-card heat/cool toggle.
The repo ships only the built
main.js, so these commits edit the bundle directly. They're here as a working reference, not a clean merge. The changes should bere-applied in the card's source and rebuilt, and the build must regenerate
main.js.gz(a stale gzip is served in preference tomain.jsand silently shadowsit. This cost me an hour of "why won't my change show up"). Diffs below describe the
exact behaviour to reproduce.
What changed
Status
coolingstring to the status tables (en: "Cooling",de: "Kühlbetrieb";other languages fall back to
en).hvac_actionofcooling/cool.Icons (mirror the heating iconography)
mdi:snowflake(instead ofmdi:radiator).mdi:snowflake-offwhen mode is cool (mirrors the persistentmdi:radiator-offheating indicator, so a cooling indicator shows even when off).Dial
hvac === "cool"as well as"heat".#2980b9) in cool mode instead of heating-red (#c0392b),for both the current-value fill and the target marker.
Heat/Cool toggle button
data-action="heat-cool-toggle") that callsclimate.set_hvac_modeon the controller's climate entity, flipping cool↔heat —mirroring the existing maintenance
set_hvac_modecall.neutral when off).
Implementation gotcha
There are two
action-buttonsmarkup blocks in the bundle — a static one and thelive one built with
${showPowerSavingButton ? …}conditionals. The button must beadded to the conditional/live block or it won't render.
Testing
Pointed at a climate entity in cool mode: off/idle shows greyed
snowflake-off; coolselected lights the dial blue; actively cooling shows the solid blue snowflake and the
status reads Cooling. Heating behaviour unchanged in heat mode.