media_player: only add a separating colon if there is a valid prefix and suffix#2060
Merged
balloob merged 1 commit intohome-assistant:devfrom Nov 19, 2018
jackwilsdon:fix-magic-colon
Merged
media_player: only add a separating colon if there is a valid prefix and suffix#2060balloob merged 1 commit intohome-assistant:devfrom jackwilsdon:fix-magic-colon
balloob merged 1 commit intohome-assistant:devfrom
jackwilsdon:fix-magic-colon
Conversation
Contributor
Author
|
I do have one note; I could condense this logic here; By changing it to something like this; if (prefix && suffix) {
return `${prefix}: ${suffix}`;
}
// Return the concatenated prefix and suffix, using an empty string if either are missing.
return (prefix || "") + (suffix || "");But I'm not sure if that is as clear / expressive of what it's trying to achieve. |
Contributor
Author
iantrich
reviewed
Nov 16, 2018
iantrich
reviewed
Nov 16, 2018
iantrich
reviewed
Nov 16, 2018
iantrich
reviewed
Nov 16, 2018
zsarnett
reviewed
Nov 16, 2018
Contributor
|
This is Much cleaner now. Great Job! |
zsarnett
approved these changes
Nov 17, 2018
Contributor
Author
|
Cheers! |
balloob
reviewed
Nov 18, 2018
This commit changes the media player entity row to only add a colon separator to the status line when there is both a prefix and a suffix.
balloob
approved these changes
Nov 19, 2018
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.


This PR changes the media player entity row to only add a colon separator to the status line when there is both a prefix and a suffix.
This issue affected my Sonos device, displaying a colon when there is nothing playing (and also when using TTS);
This change only affects the Lovelace UI.