The following code outputs the result of the promise. However, all my attempts to capture the output of the context.log into a variable have failed.
// Get light configuration
client.listLights('all').then(result => {
context.log(JSON.stringify(result, null, "\t"));
myvariable = result;
})
.catch(err => {
context.log.error('Failure ' + err);
});
context.log(myvariable);
The output on myvariable is undefined.