Skip to content
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

Weather #1201

Merged
merged 2 commits into from
Mar 8, 2023
Merged

Weather #1201

merged 2 commits into from
Mar 8, 2023

Conversation

basbruss
Copy link
Collaborator

@basbruss basbruss commented Mar 7, 2023

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • I have followed the contribution guidelines
    • This PR is for a custom-card or documentation change and therefore directed to the main branch.
    • This PR is for a official card or any other directly to the integration related change and therefore directed to the release branch.

@basbruss
Copy link
Collaborator Author

basbruss commented Mar 7, 2023

Need to revert #1170 as it breaks the card when no custom variable is set.
The custom: key does not accept any empty (null || none || {} || []) value

@basbruss basbruss changed the base branch from main to release March 8, 2023 23:00
@basbruss basbruss merged commit c6392d2 into release Mar 8, 2023
@shogun160
Copy link
Contributor

shogun160 commented Mar 10, 2023

@basbruss: What do you think about the soultion mentioned in #1192? LINK

EDIT: made a PR if you like the solution

I tested the code with following adjustments and it's working fine.

  variables:
    ulm_card_weather_backdrop: false
    ulm_card_weather_primary_info: "extrema"
    ulm_card_weather_secondary_info: "precipitation"
    ulm_card_weather_custom:
      - temp: "[[[ return entity.attributes.temperature ]]]"
  show_icon: false
  show_name: false
  show_label: false
  styles:
    grid:
      - grid-template-areas: "'item1'"
      - grid-template-columns: "1fr"
      - grid-template-rows: "min-content"
      - row-gap: "12px"
    card:
      - border-radius: "var(--border-radius)"
      - box-shadow: "var(--box-shadow)"
      - padding: "0px"
  custom_fields:
    item1:
      card:
        type: "custom:simple-weather-card"
        entity: "[[[ return entity.entity_id; ]]]"
        name: "[[[ return variables.ulm_card_weather_name || entity.attributes.friendly_name ]]]"
        primary_info: "[[[ return variables.ulm_card_weather_primary_info ]]]"
        secondary_info: "[[[ return variables.ulm_card_weather_secondary_info ]]]"
        backdrop: "[[[ return variables.ulm_card_weather_backdrop ]]]"
        custom: "[[[ return variables?.ulm_card_weather_custom ]]]"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants