I've created a watchface that shows DoNotDisturb, PhoneConected, AlarmCount and NotificationCount. All works as expected in the simulator. When onUpdate(dc) gets called each minute the new values get displayed. However on my Fenix 5X these values do not change as the minutes tick by (even if the status for these have changed). Status changes for these only appear to get updated if I move away from the watchface and come back to it. It is as though the deviceSettings is getting cached for the App.
I have created a test app that reproduces this behaviour attached. The onUpdate(dc) method is pasted at the bottom of this post:
Anyone else managed to get these deviceSettings statuses updates to change dynamically on the watchface update?
function onUpdate(dc) {
dc.setColor(textColor, backgroundColor);
dc.clear();
var deviceSettings = Sys.getDeviceSettings();
var i = 0;
var val = deviceSettings.doNotDisturb;
dc.drawText(fieldData[0], fieldData[1], font, val, Gfx.TEXT_JUSTIFY_CENTER|Gfx.TEXT_JUSTIFY_VCENTER);
i = 1;
val = deviceSettings.phoneConnected;
dc.drawText(fieldData[0], fieldData[1], font, val, Gfx.TEXT_JUSTIFY_CENTER|Gfx.TEXT_JUSTIFY_VCENTER);
i = 2;
val = deviceSettings.alarmCount;
dc.drawText(fieldData[0], fieldData[1], font, val, Gfx.TEXT_JUSTIFY_CENTER|Gfx.TEXT_JUSTIFY_VCENTER);
i = 3;
val = deviceSettings.notificationCount;
dc.drawText(fieldData[0], fieldData[1], font, val, Gfx.TEXT_JUSTIFY_CENTER|Gfx.TEXT_JUSTIFY_VCENTER);
i = 4;
var now = Time.Gregorian.info(Time.now(),Time.FORMAT_LONG);
val = Lang.format("$1$:$2$", [now.hour.format("%02d"), now.min.format("%02d")]);
dc.drawText(fieldData[0], fieldData[1], font, val, Gfx.TEXT_JUSTIFY_CENTER|Gfx.TEXT_JUSTIFY_VCENTER);
}