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 org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.avmfritz.internal.hardware.FritzAhaWebInterface;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
23 * Callback implementation for updating colortemperature. Supports reauthorization
25 * @author Christoph Sommer - Initial contribution
28 public class FritzAhaSetColorTemperatureCallback extends FritzAhaReauthCallback {
30 private final Logger logger = LoggerFactory.getLogger(FritzAhaSetColorTemperatureCallback.class);
32 private final String ain;
37 * @param webIface Interface to FRITZ!Box
38 * @param ain AIN of the device that should be switched
39 * @param temperature Color Temperature in Kelvin (typ.: 2700 to 6500)
40 * @param duration Duration of the change in 100ms. 0 immediately.
42 public FritzAhaSetColorTemperatureCallback(FritzAhaWebInterface webIface, String ain, int temperature,
44 super(WEBSERVICE_PATH,
45 "switchcmd=setcolortemperature&temperature=" + temperature + "&duration=" + duration + "&ain=" + ain,
51 public void execute(int status, String response) {
52 super.execute(status, response);
53 if (isValidRequest()) {
54 logger.debug("Received response '{}' for item '{}'", response, ain);