Closed cgHome closed 2 years ago
https://community.homey.app/t/how-do-i-use-the-driver-ready-method-in-sdkv3/71280/3 Robert's answer is correct. It also the same I told you in Slack.
Calling this.ready() inside your driver returns a Promise that is resolved when the drivers devices are inited and the driver onInit method is done.
If you override ready like you did you are breaking the SDK and your app.
I solved my problem differently. THX Chris
I want to use the Driver&Device ready() method, which according to the documentation is executed when onInit() is finished.
However, the method is called several times and at the wrong time
Unfortunately I could not find an example in the documentation for the ready() method. And now I don't know, is it because of my implementation or is this a bug in SDKv3.
Example:
In the first version of the example I made a wrong copy & paste! Sorry..
Output:
Expected:
My app code:
https://github.com/cgHome/homey.dingz/blob/be11f94e47c4d8a20fcc11a9beb6fb17d0b6c2bb/drivers/driver.js#L5 https://github.com/cgHome/homey.dingz/blob/be11f94e47c4d8a20fcc11a9beb6fb17d0b6c2bb/drivers/device.js#L50