Weather Card: Beautify#5387
Conversation
|
What about humidity and wind speed? Are those going to be displayed (if available)? |
|
Those attributes will be available via more-info window. With all of our cards the goal should not to show all details available but the most important so the card is glancable and more information can be found my clicking the card |
|
Technically, the attributes will be shown in this priority: Extrema |
| this.removeAttribute("verynarrow"); | ||
| } | ||
| if (card.offsetWidth < 200) { | ||
| this.setAttribute("veryverynarrow", ""); |
There was a problem hiding this comment.
Do we need veryverynarrow? Can't we just use verynarrow?
There was a problem hiding this comment.
Very very narrow is to deal with times when its in a horizontal stack on a phone. Makes the icon and temp stacked nicely in the center
|
Thank you to cgtobi (I cant find your github username) for the new images that don't include a shadow |
|
@bramkragten This is ready for review. |
| } | ||
|
|
||
| get _show_forecast(): boolean { | ||
| return this._config!.show_forecast || true; |
There was a problem hiding this comment.
This is a bool, so it will always return true now.
…t-card-editor.ts Co-Authored-By: Bram Kragten <mail@bramkragten.nl>
| get _show_forecast(): boolean { | ||
| return this._config!.show_forecast || true; | ||
| } |
There was a problem hiding this comment.
This might be still needed for the check in _valueChanged?
|
Comment on the layout, I think the left and right side should be aligned, now the right is higher than the left. |
| } | ||
|
|
||
| public getCardSize(): number { | ||
| return 4; |
There was a problem hiding this comment.
This should change depending on if we show forecast
| const forecast = stateObj.attributes.forecast?.length | ||
| ? stateObj.attributes.forecast.slice(0, this._narrow ? 3 : 5) | ||
| : undefined; | ||
|
|
||
| let hourly: boolean | undefined; | ||
|
|
||
| if (forecast?.length && forecast?.length > 1) { | ||
| const date1 = new Date(forecast[0].datetime); | ||
| const date2 = new Date(forecast[1].datetime); | ||
| const timeDiff = date2.getTime() - date1.getTime(); | ||
|
|
||
| hourly = timeDiff < DAY_IN_MILLISECONDS; | ||
| } |
There was a problem hiding this comment.
We should only do this if we are going to show the forecast
|
In edit mode the card is always rendered as veryverynarrow because the card doesn't get |
|
Great work, my github handle is @cgtobi ;-) |




Proposed change
Previous
New
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: