Is there a way to let an app restart itself? Or is the webapi able to restart an app?
I know flows can restart an app, but that is not what I’m looking for at this point
Homey needs a trigger to do anything.
So maybe you can use the reason why it should restart.
But restart because of a not working app mostly does not work on my Homey.
The app stopped working event only works if the app crashed. It is not triggered if the app was paused due to exzessive cpu or ram usage.
@Le_Cactus as far as I know it’s not possible to restart the app. Also not via the webAPI.
Why do you want to restart the app automatically?
Sadly though, it’s not possible to use HomeyScript to restart an app due to insufficient permissions
Because I need an async function to fetch a token, but I don’t know how to update the token after credentials have changed.
this.homey.settings.on('set', args => {
credentials = this.homey.settings.get('credentials')
token = await some-async-function(credentials)
}
This gives me an “await is only valid in async function” error and I don’t know how to some it. Restarting the app would just be a quick workaround.
(I’m just a hobbyist )
I think it should work like this:
this.homey.settings.on('set', async args => {
credentials = this.homey.settings.get('credentials')
token = await some-async-function(credentials)
}
Thanks. How can I have missed that…