Giter VIP home page Giter VIP logo

Comments (6)

nagyrobi avatar nagyrobi commented on July 17, 2024

Temporarily I replaced this card with HA's built-in markdown card showing this template, to still have the information displayed:

{% if is_state_attr('sensor.fkf_hulladek', 'garbage0', 'communal') -%}
   <ha-icon icon="mdi:trash-can-outline"></ha-icon> {{ state_attr('sensor.fkf_hulladek', 'date0') }} - Kommunális
{%- elif is_state_attr('sensor.fkf_hulladek', 'garbage0', 'selective') -%}
   <ha-icon icon="mdi:leaf"></ha-icon> {{ state_attr('sensor.fkf_hulladek', 'date0') }} - Szelektív
{%- endif %} - {{ (( as_timestamp(strptime(state_attr('sensor.fkf_hulladek', 'date0'), '%Y.%m.%d')) - as_timestamp(now())) / 86400 ) | round(0) }} nap
{% if is_state_attr('sensor.fkf_hulladek', 'garbage1', 'communal') -%}
   <ha-icon icon="mdi:trash-can-outline"></ha-icon> {{ state_attr('sensor.fkf_hulladek', 'date1') }} - Kommunális
{%- elif is_state_attr('sensor.fkf_hulladek', 'garbage1', 'selective') -%}
   <ha-icon icon="mdi:leaf"></ha-icon> {{ state_attr('sensor.fkf_hulladek', 'date1') }} - Szelektív
{%- endif %} - {{ (( as_timestamp(strptime(state_attr('sensor.fkf_hulladek', 'date1'), '%Y.%m.%d')) - as_timestamp(now())) / 86400 ) | round(0) }} nap
{% if is_state_attr('sensor.fkf_hulladek', 'garbage2', 'communal') -%}
   <ha-icon icon="mdi:trash-can-outline"></ha-icon> {{ state_attr('sensor.fkf_hulladek', 'date2') }} - Kommunális
{%- elif is_state_attr('sensor.fkf_hulladek', 'garbage2', 'selective') -%}
   <ha-icon icon="mdi:leaf"></ha-icon> {{ state_attr('sensor.fkf_hulladek', 'date2') }} - Szelektív
{%- endif %} - {{ (( as_timestamp(strptime(state_attr('sensor.fkf_hulladek', 'date2'), '%Y.%m.%d')) - as_timestamp(now())) / 86400 ) | round(0) }} nap

from fkf-garbage-collection-card.

amaximus avatar amaximus commented on July 17, 2024

Strange as the card doesn't cause high load on Android/Chrome. Could you please try to load Lovelace on Android/Chrome? If that does not cause high load then there is something with the WallPaper app.

from fkf-garbage-collection-card.

nagyrobi avatar nagyrobi commented on July 17, 2024

It causes high load on any browser on these devices.
WallPanel just uses Android's builtin System WebView, which is based on Chrome. Currently v81.0.4044.111.

from fkf-garbage-collection-card.

nagyrobi avatar nagyrobi commented on July 17, 2024

Another way to work around is creating a standard template sensor based on the fkf component:

- platform: template
  sensors:
    fkf_day0:
      unit_of_measurement: nap
      availability_template: "{{ is_state_attr('sensor.fkf_hulladek', 'current', 'current') }}"
      friendly_name_template: >-
        {% if is_state_attr('sensor.fkf_hulladek', 'garbage0', 'communal') -%}
          Kommunális
        {%- elif is_state_attr('sensor.fkf_hulladek', 'garbage0', 'selective') -%}
          Szelektív
        {%- endif %}
      value_template: >-
        {{ (( as_timestamp(strptime(state_attr('sensor.fkf_hulladek', 'date0'), '%Y.%m.%d')) - as_timestamp(now())) / 86400 -1) | round(0) }}
      icon_template: >-
        {% if is_state_attr('sensor.fkf_hulladek', 'garbage0', 'communal') -%}
          mdi:trash-can-outline
        {%- elif is_state_attr('sensor.fkf_hulladek', 'garbage0', 'selective') -%}
          mdi:leaf
        {%- endif %}
    fkf_day1:
      unit_of_measurement: nap
      availability_template: "{{ is_state_attr('sensor.fkf_hulladek', 'current', 'current') }}"
      friendly_name_template: >-
        {% if is_state_attr('sensor.fkf_hulladek', 'garbage1', 'communal') -%}
          Kommunális
        {%- elif is_state_attr('sensor.fkf_hulladek', 'garbage1', 'selective') -%}
          Szelektív
        {%- endif %}
      value_template: >-
        {{ (( as_timestamp(strptime(state_attr('sensor.fkf_hulladek', 'date1'), '%Y.%m.%d')) - as_timestamp(now())) / 86400 -1) | round(0) }}
      icon_template: >-
        {% if is_state_attr('sensor.fkf_hulladek', 'garbage1', 'communal') -%}
          mdi:trash-can-outline
        {%- elif is_state_attr('sensor.fkf_hulladek', 'garbage1', 'selective') -%}
          mdi:leaf
        {%- endif %}

from fkf-garbage-collection-card.

amaximus avatar amaximus commented on July 17, 2024

Newest release (0.6.4) added performance improvements.

Please update the card, reload the page and let me know the results.

from fkf-garbage-collection-card.

amaximus avatar amaximus commented on July 17, 2024

Any update on performance improvements on the new version? Should this issue be closed?

from fkf-garbage-collection-card.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.