I'm testing a skill I'm working on and having problems retrieving the distance units from my device. The code below works for a timezone but the distanceUnits value is 'undefined'. Any ideas on what I'm doing mistaken? SNIPPET FROM INDEX.
JS const { deviceId } = requestEnvelope.context.
System.device;
const upsServiceClient = serviceClientFactory.getUpsServiceClient(); const distanceUnits = upsServiceClient.getSystemDistanceUnits( deviceId );
const timezone = upsServiceClient.getSystemTimeZone( deviceId ); distanceUnits.then(function(result) { console.log("DISTANCE UNIT " + result); },function(err) { console.log(err); }); timezone.then(function(result) { console.log(`TIMEZONE ` + result); }, function(err) { console.log(err); });
Source: amazon.com