-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Light hui & more-info card fixes #7397
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
Changes from all commits
344b327
69c460c
3bd8f9a
169ff98
7ed5f57
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -99,7 +99,7 @@ export class HuiLightCard extends LitElement implements LovelaceCard { | |||||
| } | ||||||
|
|
||||||
| const brightness = | ||||||
| Math.round((stateObj.attributes.brightness / 254) * 100) || 0; | ||||||
| Math.round((stateObj.attributes.brightness / 255) * 100) || 0; | ||||||
|
Contributor
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. Should this be 1 now?
Suggested change
Member
Author
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 am not sure, but I think no. If for some reason we get invalid brightness value so that the first part results in an NaN, then we should not switch on the light slightly dimmed at 1%, but it should stay at 0. Or am I missing something here? |
||||||
|
|
||||||
| return html` | ||||||
| <ha-card> | ||||||
|
|
@@ -116,7 +116,8 @@ export class HuiLightCard extends LitElement implements LovelaceCard { | |||||
| <div id="controls"> | ||||||
| <div id="slider"> | ||||||
| <round-slider | ||||||
| min="0" | ||||||
| min="1" | ||||||
| max="100" | ||||||
| .value=${brightness} | ||||||
| .disabled=${UNAVAILABLE_STATES.includes(stateObj.state)} | ||||||
| @value-changing=${this._dragEvent} | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.