Search in sources :

Example 1 with SetHydrationReminderIntervalRequest

use of nodomain.freeyourgadget.gadgetbridge.service.devices.lefun.requests.SetHydrationReminderIntervalRequest in project Gadgetbridge by Freeyourgadget.

the class LefunDeviceSupport method sendHydrationReminderIntervalSetting.

/**
 * Sends the hydration reminder interval setting to the device
 *
 * @param period the reminder interval
 */
private void sendHydrationReminderIntervalSetting(int period) {
    try {
        TransactionBuilder builder = performInitialized(SetHydrationReminderIntervalRequest.class.getSimpleName());
        SetHydrationReminderIntervalRequest request = new SetHydrationReminderIntervalRequest(this, builder);
        request.setInterval(period);
        request.perform();
        inProgressRequests.add(request);
        performConnected(builder.getTransaction());
    } catch (IOException e) {
        GB.toast(getContext(), "Failed to set hydration reminder interval", Toast.LENGTH_SHORT, GB.ERROR, e);
    }
}
Also used : TransactionBuilder(nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder) IOException(java.io.IOException) SetHydrationReminderIntervalRequest(nodomain.freeyourgadget.gadgetbridge.service.devices.lefun.requests.SetHydrationReminderIntervalRequest)

Aggregations

IOException (java.io.IOException)1 TransactionBuilder (nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder)1 SetHydrationReminderIntervalRequest (nodomain.freeyourgadget.gadgetbridge.service.devices.lefun.requests.SetHydrationReminderIntervalRequest)1