Hi,
I’m looking for a code example on how to read a settings value from the newSettings object parameter in the Device::onSettings() function. I have defined a “checkbox” type setting in the driver.settings.compose.json file. I can see that the settings key+value are in the newSettings object (using “this.log(newSettings)”), but I can’t figure out how to read the actual value from the object in my device code. Probably because I don’t fully get TypeScript…
Do I need to change the onSettings() function definition (compared to the code in Settings | Homey Apps SDK) in my project to indicate object type of the newSettings parameter?
“homey app build” just fails with:
error TS2339: Property ‘abc’ does not exist on type ‘{}’.
when I in my onSettings() try to call
this.log(newSettings.abc)"
Thanks!