I am working on a new application (to integrate Casambi devices), for which I want to store the username and password to an external service via the settings-screen, so you don’t have to login for every device and can change the password on its gateway afterwards.
In order to access the external service I have to provide an API-key/secret as well, which I have placed in a env.json file, which is provided to Homey on install, and can be seen in my app.js code via Homey.env.API_KEY. However this env is not available via my api.js code, in which Homey.env = {} .
My setttings form saves the username and password, after I tested via an API-call to my app on Homey (with the secret), that the username and password combination on the service or correct, but without secret this is of course not possible.
Is this done on purpose? Or is there a workaround for this?
The alternative is that I ask for a username and password when adding a device, but when you than change the password on the service, you have to reinstall every device, or is there an alternative for that?