Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--rgb-*-*-color not retrieved automatically for cover-entity (presumably just any (binary) entity that has no 'on'-state) #160

Open
arvidc opened this issue Oct 12, 2023 · 0 comments

Comments

@arvidc
Copy link

arvidc commented Oct 12, 2023

The problem

Preface: I'm too unfamiliar with github (and especially pull requests) to submit a fix directly. But there is a (possibly partial, not sure if this extends to anywhere else) suggestion below.

Unlike what is suggested here, buttons for my cover entities do not automatically get the same color as --rgb-cover-active-color:

- `--pbs-button-rgb-state-color` – this is set automatically to reference an `--rgb-state-*-color` variable.

What version of Paper Buttons Row has the issue?

2.1.3

What version of Home Assistant are you running?

2023.10.1

What version of the Frontend are you running?

20231005.0 - latest

Additional information

I believe the issue is that the check here is for stateObj.state === STATE_ON (so it only works with entities that have an "on" active state) instead of STATES_ON.has(stateObj.state) (which includes "on", but also "open" and "unlocked").

// from `domain`
if (stateObj.state === STATE_ON || stateObj.state === STATE_OFF) {
const active = stateObj.state === STATE_ON ? "active" : "inactive";

I made that change locally in "paper-buttons-row.js" (well:Dt.has(r.state); in both instances) and that appears to have fixed it for me.

@arvidc arvidc changed the title --rgb-*-*-color not retrieved automatically for cover-entity (presumably just any (binary) entity that has a different state than on/off) --rgb-*-*-color not retrieved automatically for cover-entity (presumably just any (binary) entity that has no 'on'-state) Oct 12, 2023
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

No branches or pull requests

1 participant