Fix sensor card from not working with detail#7060
Merged
Conversation
bramkragten
reviewed
Sep 21, 2020
| .configValue=${"unit"} | ||
| @value-changed=${this._valueChanged} | ||
| ></paper-input> | ||
| <ha-formfield label="Show more detail"> |
bramkragten
reviewed
Sep 21, 2020
Comment on lines
+197
to
+206
| const target = ev.target! as EditorTarget; | ||
| const value = target.checked ? 2 : 1; | ||
|
|
||
| if (this[`_${target.configValue}`] === value) { | ||
| return; | ||
| } | ||
|
|
||
| this._config = { | ||
| ...this._config, | ||
| [target.configValue!]: value, |
Member
There was a problem hiding this comment.
This is really specific for the detail option, so let's not make the rest generic
bramkragten
reviewed
Sep 21, 2020
Comment on lines
+162
to
+166
| <ha-switch | ||
| .checked=${this._detail === 2} | ||
| .configValue=${"detail"} | ||
| @change=${this._change} | ||
| ></ha-switch> |
Member
There was a problem hiding this comment.
Do we want this to be a switch or a slider?
Contributor
Author
There was a problem hiding this comment.
Slider? Its only 2 values
Contributor
Author
There was a problem hiding this comment.
Detail or no detail
Member
There was a problem hiding this comment.
oh... why it is a number then? 😝
Contributor
Author
There was a problem hiding this comment.
no idea. Mentioned that above. 0 idea why this was made a number. I converted it to Typescript. Can't remember if I created this or not.
Member
There was a problem hiding this comment.
Oh, should I read the description of the PR? 🙈
bramkragten
approved these changes
Sep 21, 2020
Merged
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Breaking change
Proposed change
I do not know how we left this for so long. The detail field was looking at
this._config.numberinstead ofthis._config.detail. Like its been that way since creation.My change makes this a switch. There are only two values this can be and I have 0 idea why it was made a number field in the first place
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: