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.avmfritz.internal.hardware.callbacks;
15 import static org.eclipse.jetty.http.HttpMethod.GET;
17 import java.math.BigDecimal;
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.openhab.binding.avmfritz.internal.hardware.FritzAhaWebInterface;
21 import org.slf4j.Logger;
22 import org.slf4j.LoggerFactory;
25 * Callback implementation for updating heating values Supports reauthorization
27 * @author Christoph Weitkamp - Initial contribution
28 * @author Christoph Weitkamp - Added support for AVM FRITZ!DECT 300 and Comet
32 public class FritzAhaSetHeatingTemperatureCallback extends FritzAhaReauthCallback {
34 private final Logger logger = LoggerFactory.getLogger(FritzAhaSetHeatingTemperatureCallback.class);
36 private static final String WEBSERVICE_COMMAND = "switchcmd=sethkrtsoll";
38 private final String ain;
43 * @param webIface Interface to FRITZ!Box
44 * @param ain AIN of the device that should be switched
45 * @param temperature New temperature
47 public FritzAhaSetHeatingTemperatureCallback(FritzAhaWebInterface webIface, String ain, BigDecimal temperature) {
48 super(WEBSERVICE_PATH, WEBSERVICE_COMMAND + "&ain=" + ain + "¶m=" + temperature, webIface, GET, 1);
53 public void execute(int status, String response) {
54 super.execute(status, response);
55 if (isValidRequest()) {
56 logger.debug("Received response '{}' for item '{}'", response, ain);