Closed Hiekkaharju closed 1 month ago
The history is loaded async, so it could be it's just slow.
I added unsubscribe logic hopefully solving this.
Sorry but this seems to still exist. And now I checked also "from the view with the card to another and then back" with browser and that also fails (view= "tabs" on a dashboard. When going to another dashboard and then returning works = from sidebar.
Can you take a look at the Browser console to see if you see any error?
1st: I'm no web developer, I just and just knew where to find the console :) Please don't expect much... Not really any errors. [Violation] 'requestAnimationFrame' handler took ###ms comes, but it also comes with F5 refresh succesful draw. When leaving the view, I see unsubscribe notices. But only with F5 or dashbord change I see "First render.." and subscribe notices, not by just a view change
I might have figured this out. Adding this.firstRenderWithMap = true; to e.g. place where this.map.remove(); is done, seems to fix the issue.
Very interesting @Hiekkaharju! I just noticed I might have the same issues in certain cases. Will try your work around!
Seems to work. Thanks again :)
OT + FYI: I see you added fallback coordinates. If I read the code correctly they will be used only if longitude/latitude is empty. I've a device which returns -1,-1 as coordinates if it can't get a fix. I don't know if that's common. I've already earlier made an automation which replaces those -1,-1 with fixed coordinates using see-service, so I do not need support for -1 fallback, but somone else might.
Problem is -1,-1 however unlikely is a valid coordinate. Would be better to set it to null.
It would not be hard to check for this. WDYT @Hiekkaharju?
Based on your previous reply, if I were you, I would leave it for now and if someone else later asks for it, take this as a +1
edit: I decided to add info that the -1,-1 I have seen is generated by an esphome device. Thus it's likelihood in HA enviroment is bigger than that of some random device.
there is some issue with initial drawing, In some cases, at least right after dashboard edit, no indication of any trackers or history is drawn. On a browser e.g. f5 refresh fixes this. Apparently -on android companion app- also just dashboard tab change from the view with the card to another and then back leaves the data undrawn. I'm not aware of any refresh that would fix, exept restarting whole HA companion app.