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.
openhab#15 Write test for changing (color)brightness for RGB
- Loading branch information
Showing
7 changed files
with
107 additions
and
14 deletions.
There are no files selected for viewing
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
18 changes: 18 additions & 0 deletions
18
.../src/main/java/org/openhab/binding/supla/internal/cloud/executors/LedCommandExecutor.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,18 @@ | ||
package org.openhab.binding.supla.internal.cloud.executors; | ||
|
||
import org.eclipse.smarthome.core.library.types.HSBType; | ||
import org.eclipse.smarthome.core.library.types.PercentType; | ||
import org.eclipse.smarthome.core.thing.ChannelUID; | ||
import pl.grzeslowski.jsupla.api.generated.ApiException; | ||
|
||
public interface LedCommandExecutor { | ||
void setLedState(ChannelUID channelUID, PercentType brightness); | ||
|
||
void setLedState(ChannelUID channelUID, HSBType hsb); | ||
|
||
void changeColor(final int channelId, final ChannelUID channelUID, final HSBType command) throws ApiException; | ||
|
||
void changeColorBrightness(final int channelId, final ChannelUID channelUID, final PercentType command) throws ApiException; | ||
|
||
void changeBrightness(final int channelId, final ChannelUID channelUID, final PercentType command) throws ApiException; | ||
} |
7 changes: 7 additions & 0 deletions
7
...in/java/org/openhab/binding/supla/internal/cloud/executors/LedCommandExecutorFactory.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,7 @@ | ||
package org.openhab.binding.supla.internal.cloud.executors; | ||
|
||
import org.openhab.binding.supla.internal.cloud.api.ChannelsCloudApi; | ||
|
||
public interface LedCommandExecutorFactory { | ||
LedCommandExecutor newLedCommandExecutor(ChannelsCloudApi channelsCloudApi); | ||
} |
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
12 changes: 12 additions & 0 deletions
12
...va/org/openhab/binding/supla/internal/cloud/executors/SuplaLedCommandExecutorFactory.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,12 @@ | ||
package org.openhab.binding.supla.internal.cloud.executors; | ||
|
||
import org.openhab.binding.supla.internal.cloud.api.ChannelsCloudApi; | ||
|
||
public final class SuplaLedCommandExecutorFactory implements LedCommandExecutorFactory { | ||
public static final SuplaLedCommandExecutorFactory FACTORY = new SuplaLedCommandExecutorFactory(); | ||
|
||
@Override | ||
public LedCommandExecutor newLedCommandExecutor(final ChannelsCloudApi channelsCloudApi) { | ||
return new SuplaLedCommandExecutor(channelsCloudApi); | ||
} | ||
} |
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