Does someone have a Garmin TEMPE sensor, that can help me do a simple test of an app that uses it? I can give you a free unlock code to any of my apps in exchange for assistance to get this app working.
Does someone have a Garmin TEMPE sensor, that can help me do a simple test of an app that uses it? I can give you a free unlock code to any of my apps in exchange for assistance to get this app working.
It's easy to use a Tempe - I've had one for years.
Enable it, and set the callback:
Sensor.setEnabledSensors([Sensor.SENSOR_TEMPERATURE]); Sensor.enableSensorEvents(method(:sensorEvents));
and in the callback check for null
function sensorEvents(info) { if(info.temperature!=null) { //save it off Ui.requestUpdate(); } }
The above is for a device app or widget.
In a data field. to work on all watches, you want to use a background service to get it's data and have a temporal event that just returns
Sensor.getInfo().temperature
You really cant use a background service to get it in a watch face with a Tempe. Once you enable it, it can take a minute to connect and the background can run 30 seconds at most, so you'll have issues connecting.
Once connected, the Tempe updates it's data once a minute.
On some newer watches, if there is no Tempe paired or it hasn't connected yet, temperature in Sensor.Info will be the internal sensor sensor, so how this works can depend on the watch you are using.
There is no access to the 24 hour high and low with CIQ, so you need to maintain that yourself.
Thanks.
If applying this in a data field, do I need to call
Sensor.setEnabledSensors([Sensor.SENSOR_TEMPERATURE]);
??
The API docs say it cannot be called from a data field, but it is unclear if that applies when putting it in a background process.
No, in a DF you just need to use Sensor.getInfo().temperature. The Tempe is already enabled/connected by the activity itself (if it's available) - kind of like if you have a heart rate sensor
the background for a DF can be very simple with this for the temporal event
function onTemporalEvent() { Background.exit(Sensor.getInfo().temperature); }:
If temperature is null, onBackgroundData() won't be called.