tibber / com.tibber.athom

Tibber app for Athom Homey
16 stars 4 forks source link

Make sure all setCapabilityValue promises has finished before triggers + "todays lowes/highest prices fix" #26

Closed pteigen closed 2 years ago

pteigen commented 2 years ago

Users, including me, seems to expect global tags are set when the triggers are fired.

Use the code if you want to. I've tested a bit with this code and it seems to work more consistant. Before the change the global tags did not update as long as I tested it (over a few days) in time to be updated when the "price changed" trigger triggered.

jstaro commented 2 years ago

Good catch. Will test a bit but this looks good. I suspect this has always been an issue. There might be an issue with non-awaited promises in the phase current updates as well that surfaced after migrating to SDK v3.

Thank you for taking the time.

pteigen commented 2 years ago

Hi @jstaro. I looked into the bug on todays lowest/highest prices. Added a commit to this same PR

jstaro commented 2 years ago

@pteigen Wonderful! I've been testing these two things today and it seems to work well. We'll release a new version with your fixes (and some additional ones, like for example less flaky device pairing) soon.

Again, thanks for your help.

pteigen commented 2 years ago

Happy to help :)

jstaro commented 2 years ago

Both these fixes are now integrated into the latest HEAD and available in the v1.5.11 test version that became available earlier today.