forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[avmfritz] Add light blub color temperature support (openhab#14373)
* added light blub color temperature support * align valiable nameing * fixed on off behavior of lights * change to math scaleing * add abs color temperature channel --------- Signed-off-by: Tobias Lange <[email protected]> Signed-off-by: Thomas Burri <[email protected]>
- Loading branch information
1 parent
76c62a0
commit 20ba373
Showing
7 changed files
with
238 additions
and
40 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...hab/binding/avmfritz/internal/hardware/callbacks/FritzAhaSetColorTemperatureCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** | ||
* Copyright (c) 2010-2023 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.avmfritz.internal.hardware.callbacks; | ||
|
||
import static org.eclipse.jetty.http.HttpMethod.GET; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.openhab.binding.avmfritz.internal.hardware.FritzAhaWebInterface; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* Callback implementation for updating colortemperature. Supports reauthorization | ||
* | ||
* @author Christoph Sommer - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class FritzAhaSetColorTemperatureCallback extends FritzAhaReauthCallback { | ||
|
||
private final Logger logger = LoggerFactory.getLogger(FritzAhaSetColorTemperatureCallback.class); | ||
|
||
private final String ain; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param webIface Interface to FRITZ!Box | ||
* @param ain AIN of the device that should be switched | ||
* @param temperature Color Temperature in Kelvin (typ.: 2700 to 6500) | ||
* @param duration Duration of the change in 100ms. 0 immediately. | ||
*/ | ||
public FritzAhaSetColorTemperatureCallback(FritzAhaWebInterface webIface, String ain, int temperature, | ||
int duration) { | ||
super(WEBSERVICE_PATH, | ||
"switchcmd=setcolortemperature&temperature=" + temperature + "&duration=" + duration + "&ain=" + ain, | ||
webIface, GET, 1); | ||
this.ain = ain; | ||
} | ||
|
||
@Override | ||
public void execute(int status, String response) { | ||
super.execute(status, response); | ||
if (isValidRequest()) { | ||
logger.debug("Received response '{}' for item '{}'", response, ain); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters