-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Hide wind speed and direction #190
Conversation
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.
Thanks so much for your contribution! I like the idea of being able to show only wind speed or direction. I think that we can achieve the same result without adding more flags though.
Can you please refactor to make show_wind
take these values:
true
: show both wind speed and directionfalse
: show neither speed nor direction'speed'
: show only wind speed'direction'
: show only wind direction
Then, in the editor UI, you can just replace the existing wind switch with a drop-down or similar to choose from these options.
What do you think?
Cool. Good idea. I didn't really like the separate flags thing either.
…--Adam
On Thu, Oct 20, 2022 at 10:21 AM Jonathan Keslin ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Thanks so much for your contribution! I like the idea of being able to
show only wind speed or direction. I think that we can achieve the same
result without adding more flags though.
Can you please refactor to make show_wind take these values:
- true: show both wind speed and direction
- false: show neither speed nor direction
- 'speed': show only wind speed
- 'direction': show only wind direction
Then, in the editor UI, you can just replace the existing wind switch with
a drop-down or similar to choose from these options.
What do you think?
—
Reply to this email directly, view it on GitHub
<#190 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHIXJVNRWF24AU6XEV6LS2DWEFIOPANCNFSM6AAAAAARKGCEBY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
So haven't done this because I am getting something very weird in the
editor. Not sure if you have experienced this.
I can edit my new field fine (show_wind one of those for choices) in the UI
editor, but if I switch to editing in yaml, the moment I try to change the
show_wind element in the yaml, it deletes the whole line and the cursor
goes to the beginning of the code block. Seems to be some sort of
validation thing maybe?
If I re-type the line in the YAML, it works, and if I switch back to the UI
editor, it takes the new value. But I haven't seen this behaviour before
in any other extensions, so I feel I have something bad somewhere.
I guess I will commit it -- see if it happens for you.
…--Adam
On Thu, Oct 20, 2022 at 12:30 PM Adam Kropp ***@***.***> wrote:
Cool. Good idea. I didn't really like the separate flags thing either.
--Adam
On Thu, Oct 20, 2022 at 10:21 AM Jonathan Keslin ***@***.***>
wrote:
> ***@***.**** requested changes on this pull request.
>
> Thanks so much for your contribution! I like the idea of being able to
> show only wind speed or direction. I think that we can achieve the same
> result without adding more flags though.
>
> Can you please refactor to make show_wind take these values:
>
> - true: show both wind speed and direction
> - false: show neither speed nor direction
> - 'speed': show only wind speed
> - 'direction': show only wind direction
>
> Then, in the editor UI, you can just replace the existing wind switch
> with a drop-down or similar to choose from these options.
>
> What do you think?
>
> —
> Reply to this email directly, view it on GitHub
> <#190 (review)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AHIXJVNRWF24AU6XEV6LS2DWEFIOPANCNFSM6AAAAAARKGCEBY>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***
> com>
>
|
true, false, speed, or direction
Thanks for updating. I'll probably have time to look more next week. In the meantime, I'll toss on the hacktoberfest-accepted label in case you're participating in that. |
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.
Played with it a little and I do see the editor behavior you described. However, that same behavior happens on the entity
field and that logic comes from the base custom card template repo. So, I'm inclined to just let it be as-is. If someone really wants to manage their cards in YAML and needs to mess with this field, then they can either use the dashboard-level YAML editor, or they can compose elsewhere and paste in to avoid the partial text validation problem.
Just a small refactor request for how you render the wind elements and I think we'll be good to go.
Co-authored-by: Jonathan Keslin <decompil3d@users.noreply.github.com>
Co-authored-by: Jonathan Keslin <decompil3d@users.noreply.github.com>
Sounds good. |
Wanted to be able to only show the wind speed (without the direction). For completeness, added two flags: hide_wind_speed and hide_wind_direction. They work in concert with show_wind, and default to false (so the existing behavior).