2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.plugwise.internal.protocol;
15 import static org.openhab.binding.plugwise.internal.protocol.field.MessageType.SENSE_REPORT_INTERVAL_SET_REQUEST;
17 import java.time.Duration;
19 import org.openhab.binding.plugwise.internal.protocol.field.MACAddress;
22 * Sets the Sense temperature and humidity measurement report interval. Based on this interval, periodically a
23 * {@link SenseReportRequestMessage} is sent.
25 * @author Wouter Born - Initial contribution
27 public class SenseReportIntervalSetRequest extends Message {
29 private Duration reportInterval;
31 public SenseReportIntervalSetRequest(MACAddress macAddress, Duration reportInterval) {
32 super(SENSE_REPORT_INTERVAL_SET_REQUEST, macAddress);
33 this.reportInterval = reportInterval;
37 protected String payloadToHexString() {
38 return String.format("%02X", reportInterval.toMinutes());