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
Add active state for cover, input_boolean, group and device_tracker #2431
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,11 @@ class StateBadge extends PolymerElement { | |
ha-icon[data-domain="light"][data-state="on"], | ||
ha-icon[data-domain="switch"][data-state="on"], | ||
ha-icon[data-domain="binary_sensor"][data-state="on"], | ||
ha-icon[data-domain="input_boolean"][data-state="on"], | ||
ha-icon[data-domain="fan"][data-state="on"], | ||
ha-icon[data-domain="cover"][data-state="open"], | ||
ha-icon[data-domain="device_tracker"][data-state="home"], | ||
ha-icon[data-domain="group"][data-state="on"], | ||
ha-icon[data-domain="sun"][data-state="above_horizon"] { | ||
color: var(--paper-item-icon-active-color, #fdd835); | ||
} | ||
|
@@ -92,7 +96,7 @@ class StateBadge extends PolymerElement { | |
if (typeof brightness !== "number") { | ||
errorMessage = `Type error: state-badge expected number, but type of ${ | ||
newVal.entity_id | ||
}.attributes.brightness is ${typeof brightness} (${brightness})`; | ||
}.attributes.brightness is ${typeof brightness} (${brightness})`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
// eslint-disable-next-line | ||
console.warn(errorMessage); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,33 +96,33 @@ class HuiEntityButtonCard extends hassLocalizeLitMixin(LitElement) | |
.longPress="${longPress()}" | ||
> | ||
${ | ||
!stateObj | ||
? html` | ||
!stateObj | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file shouldn't have been changed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The file or just those lines? My editor (vscode) decided to "fix" that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. vscode lied to you. Get the 'Prettier - Code formatter' extension. There are some recommended plugins for this project that should be suggested when you open vscode at search There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just fixed it by hand. |
||
? html` | ||
<div class="not-found"> | ||
Entity not available: ${this._config.entity} | ||
</div> | ||
` | ||
: html` | ||
: html` | ||
<paper-button> | ||
<div> | ||
<ha-icon | ||
data-domain="${computeStateDomain(stateObj)}" | ||
data-state="${stateObj.state}" | ||
.icon="${this._config.icon || stateIcon(stateObj)}" | ||
style="${ | ||
styleMap({ | ||
filter: this._computeBrightness(stateObj), | ||
color: this._computeColor(stateObj), | ||
}) | ||
}" | ||
styleMap({ | ||
filter: this._computeBrightness(stateObj), | ||
color: this._computeColor(stateObj), | ||
}) | ||
}" | ||
></ha-icon> | ||
<span> | ||
${this._config.name || computeStateName(stateObj)} | ||
</span> | ||
</div> | ||
</paper-button> | ||
` | ||
} | ||
} | ||
</ha-card> | ||
`; | ||
} | ||
|
@@ -151,7 +151,11 @@ class HuiEntityButtonCard extends hassLocalizeLitMixin(LitElement) | |
ha-icon[data-domain="light"][data-state="on"], | ||
ha-icon[data-domain="switch"][data-state="on"], | ||
ha-icon[data-domain="binary_sensor"][data-state="on"], | ||
ha-icon[data-domain="input_boolean"][data-state="on"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. alphabetize on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
ha-icon[data-domain="fan"][data-state="on"], | ||
ha-icon[data-domain="cover"][data-state="open"], | ||
ha-icon[data-domain="device_tracker"][data-state="home"], | ||
ha-icon[data-domain="group"][data-state="on"], | ||
ha-icon[data-domain="sun"][data-state="above_horizon"] { | ||
color: var(--paper-item-icon-active-color, #fdd835); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alphabetize on
data-domain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done