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

show_points: false #1083

Open
dusan-ivanco opened this issue Feb 23, 2024 · 4 comments
Open

show_points: false #1083

dusan-ivanco opened this issue Feb 23, 2024 · 4 comments

Comments

@dusan-ivanco
Copy link

show_points: false make exception

          - type: custom:mini-graph-card
            name: Teplota
            icon: mdi:thermometer
            aggregate_func: median
            points_per_hour: 1
            hours_to_show: 12
            line_width: 5
            decimals: 1
            smoothing: true
            hour24: true
            show:
              state: last
              points: false
            tap_action:
              action: none
            entities:
              - entity: sensor.temperature
                name: Priemer
              - entity: sensor.thermo_room_1_temperature
              - entity: sensor.thermo_room_2_temperature
              - entity: sensor.thermo_room_3_temperature
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')
    at Kd.getEntityState (graph-card.js?v=0.12.0:1:100443)
    at Kd.renderState (graph-card.js?v=0.12.0:1:100638)
    at Kd.renderStates (graph-card.js?v=0.12.0:1:100127)
    at Kd.render (graph-card.js?v=0.12.0:1:99132)
    at Kd.update (graph-card.js?v=0.12.0:1:49160)
    at Kd.performUpdate (graph-card.js?v=0.12.0:1:46377)
    at graph-card.js?v=0.12.0:1:46037
    at Generator.throw (<anonymous>)
    at R (graph-card.js?v=0.12.0:1:17743)
    at g (graph-card.js?v=0.12.0:1:17962)
@ildar170975
Copy link
Collaborator

ildar170975 commented Feb 23, 2024

Show a screenshot with a card in the native HA editor and with this error.

Also, the error which you posted contains a "graph-card.js" filename - but the card's filename is "mini-graph-card-bundle.js". Are you sure that the error is related?
Have you manually edited the original js-file?

Update: managed to reproduce it with a simple config:

type: custom:mini-graph-card
show:
  state: last
entities:
  - entity: sensor.xiaomi_cg_1_temperature
  - entity: sensor.xiaomi_cg_2_temperature
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')
    at Kd.getEntityState (mini-graph-card-bundle.js?hacstag=1512800620120:1:100443)
    at Kd.renderState (mini-graph-card-bundle.js?hacstag=1512800620120:1:100638)
    at Kd.renderStates (mini-graph-card-bundle.js?hacstag=1512800620120:1:100127)
    at Kd.render (mini-graph-card-bundle.js?hacstag=1512800620120:1:99132)
    at Kd.update (mini-graph-card-bundle.js?hacstag=1512800620120:1:49160)
    at Kd.performUpdate (mini-graph-card-bundle.js?hacstag=1512800620120:1:46377)
    at mini-graph-card-bundle.js?hacstag=1512800620120:1:46037
    at Generator.next (<anonymous>)
    at R (mini-graph-card-bundle.js?hacstag=1512800620120:1:17743)
    at f (mini-graph-card-bundle.js?hacstag=1512800620120:1:17926)

and it is rather erratic.

In fact, it seems to be about state: last.
Suggest to retest with a simplified code & then rename the issue to reflect a possible cause.

@dusan-ivanco
Copy link
Author

works:
Snímka obrazovky 2024-02-29 o 13 28 24
Snímka obrazovky 2024-02-29 o 13 30 50

not:
Snímka obrazovky 2024-02-29 o 13 33 39
Snímka obrazovky 2024-02-29 o 13 31 26

Yes, I renamed the js file.

@dusan-ivanco
Copy link
Author

yes, option "points: false" is in conflict with "state: last"

@akloeckner
Copy link
Collaborator

It might be addressed by this PR: #1075 ?

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

No branches or pull requests

3 participants