Closed akloeckner closed 1 year ago
@ildar170975, can you run this fix on your end, too, to see if it really fixes the issue?
@akloeckner Unfortunately, right now do not have a devcontainer to test this fix; could you create a js file - so I will replace it manually & test? I mean "mini-graph-card-bundle.js"....
I added the bundle js to the PR. I'll just have to remember to remove it again before merging...
Thanks a lot !!!
Tested with new "mini-graph-card-bundle.js".
https://github.com/kalkih/mini-graph-card/issues/960 - seems to be fixed:
Surely more tests are required, will do it these days.
Also, (another issue probably) console log is flooded with "fetch finished" - is it expected?
Thanks for testing! Let me know, when you're ok to merge! I'll create a new dev release then.
As to the fetches, that might be related to #935 ? I didn't notice that many requests yet. I think, there should be one request per graph.
Let me know, when you're ok to merge!
This particular issue (https://github.com/kalkih/mini-graph-card/issues/960) seems to be solved. Gonna close https://github.com/kalkih/mini-graph-card/issues/960.
Currently I am mostly satisfied with the current implementation. The only critical issue for me is https://github.com/kalkih/mini-graph-card/issues/944 - but again, not life-critical )))
Ok, I'll merge this then. And will have a look at #944 later...
:tada: This PR is included in version 0.12.0-dev.3 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
I just noticed: This fix will not work, if the last change is even outside of the scope of the recorder component in home assistant. The HA history API just reports nothing in this case. I guess, there is not much we can do here. We can rather file an issue with HA to include such state in the history response, maybe.
outside of the scope of the recorder component in home assistant
Assume that Recorder has 10-days history.
Assume that some sensor was changed 11 days ago, currently it's value is 100.
I expect to see a flatline with a value "100" - for ANY hours_to_show
(even > 240).
Could you elaborate what possible errors we may have?
I expect to see a flatline with a value "100" - for ANY
hours_to_show
(even > 240).
Exactly. But I seem to have no line at all in that case. In the dev tools of the browser, I have checked the response of the API request and it is simply []
. I have no easy and reliable way to reproduce, though.
I see no issues so far.
My test with some input_number
which was changed a long time ago:
A bit "enriched" case:
Recorder has 10 days.
Code:
type: vertical-stack
cards:
- type: custom:mini-graph-card
entities:
- input_number.air_pm25_level_1
aggregate_func: last
points_per_hour: 60
smoothing: false
- type: custom:mini-graph-card
entities:
- input_number.air_pm25_level_1
hours_to_show: 72
aggregate_func: last
points_per_hour: 60
smoothing: false
- type: custom:mini-graph-card
entities:
- input_number.air_pm25_level_1
hours_to_show: 250
aggregate_func: last
points_per_hour: 60
smoothing: false
Hmm... Looks good to me. My data has also changed in the meantime, so... I guess, I'll observe and open a separate issue, once it happens again.
:tada: This PR is included in version 0.12.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
This re-insures the logic to keep the last known state before the start of our grah interval within the history. While this is not really correct, it allows for rendering steady-state-graphs.
This element was mistakenly removed in #881.
The piece of code relies on history being chronographical.
fixes #960