|
9 | 9 | import org.eclipse.smarthome.core.library.types.OpenClosedType;
|
10 | 10 | import org.eclipse.smarthome.core.library.types.PercentType;
|
11 | 11 | import org.eclipse.smarthome.core.library.types.StopMoveType;
|
12 |
| -import org.eclipse.smarthome.core.library.types.StringType; |
13 | 12 | import org.eclipse.smarthome.core.library.types.UpDownType;
|
14 | 13 | import org.eclipse.smarthome.core.thing.Bridge;
|
15 | 14 | import org.eclipse.smarthome.core.thing.ChannelUID;
|
|
69 | 68 | import static org.mockito.Mockito.doAnswer;
|
70 | 69 | import static org.mockito.Mockito.times;
|
71 | 70 | import static org.mockito.Mockito.verify;
|
72 |
| -import static org.openhab.binding.supla.SuplaBindingConstants.Commands.OFF_LIGHT_COMMAND; |
73 |
| -import static org.openhab.binding.supla.SuplaBindingConstants.Commands.OPEN_CLOSE_GATE_COMMAND; |
74 |
| -import static org.openhab.binding.supla.SuplaBindingConstants.Commands.WHITE_LIGHT_COMMAND; |
75 | 71 | import static org.openhab.binding.supla.SuplaBindingConstants.SUPLA_DEVICE_CLOUD_ID;
|
76 | 72 | import static org.openhab.binding.supla.internal.cloud.AdditionalChannelType.EXTRA_LIGHT_ACTIONS;
|
77 | 73 | import static org.openhab.binding.supla.internal.cloud.AdditionalChannelType.LED_BRIGHTNESS;
|
78 | 74 | import static pl.grzeslowski.jsupla.api.generated.model.ChannelFunctionActionEnum.CLOSE;
|
79 | 75 | import static pl.grzeslowski.jsupla.api.generated.model.ChannelFunctionActionEnum.OPEN;
|
80 |
| -import static pl.grzeslowski.jsupla.api.generated.model.ChannelFunctionActionEnum.OPEN_CLOSE; |
81 | 76 | import static pl.grzeslowski.jsupla.api.generated.model.ChannelFunctionActionEnum.REVEAL;
|
82 | 77 | import static pl.grzeslowski.jsupla.api.generated.model.ChannelFunctionActionEnum.REVEAL_PARTIALLY;
|
83 | 78 | import static pl.grzeslowski.jsupla.api.generated.model.ChannelFunctionActionEnum.SHUT;
|
@@ -435,60 +430,6 @@ void moveRollerShutter() throws Exception {
|
435 | 430 | verify(channelsCloudApi, times(0)).executeAction(channelExecuteActionRequestCaptor.capture(), eq(rollerShutterChannelId));
|
436 | 431 | }
|
437 | 432 |
|
438 |
| - @ParameterizedTest |
439 |
| - @ValueSource(strings = {"gateChannelId", "garageDoorChannelId"}) |
440 |
| - @DisplayName("show send request to Supla CLoud to OPEN/CLOSE gate or garage door") |
441 |
| - void openCloseGateAndGarage(String idFieldName) throws Exception { |
442 |
| - |
443 |
| - // given |
444 |
| - final int id = (int) FieldUtils.readDeclaredField(this, idFieldName, true); |
445 |
| - final ChannelUID channelUID = buildChannelUID(id); |
446 |
| - |
447 |
| - // when |
448 |
| - handler.handleStringCommand(channelUID, new StringType(OPEN_CLOSE_GATE_COMMAND)); |
449 |
| - |
450 |
| - // then |
451 |
| - verify(channelsCloudApi).executeAction(channelExecuteActionRequestCaptor.capture(), eq(id)); |
452 |
| - ChannelExecuteActionRequest value = channelExecuteActionRequestCaptor.getValue(); |
453 |
| - assertThat(value.getAction()).isEqualTo(OPEN_CLOSE); |
454 |
| - } |
455 |
| - |
456 |
| - @ParameterizedTest |
457 |
| - @ValueSource(strings = {"rgbChannelId", "dimmerAndRgbChannelId"}) |
458 |
| - @DisplayName("should send request to LedExecutor to change color to white") |
459 |
| - void setLightColorToWhite(String idFieldName) throws Exception { |
460 |
| - |
461 |
| - // given |
462 |
| - final int id = (int) FieldUtils.readDeclaredField(this, idFieldName, true); |
463 |
| - final ChannelUID channelUID = buildChannelUID(id, EXTRA_LIGHT_ACTIONS); |
464 |
| - final ChannelUID parentChannelUID = buildChannelUID(id); |
465 |
| - |
466 |
| - // when |
467 |
| - handler.handleStringCommand(channelUID, new StringType(WHITE_LIGHT_COMMAND)); |
468 |
| - |
469 |
| - // then |
470 |
| - verify(ledCommandExecutor).changeColor(id, parentChannelUID, HSBType.WHITE); |
471 |
| - verify(callback).stateUpdated(parentChannelUID, HSBType.WHITE); |
472 |
| - } |
473 |
| - |
474 |
| - @ParameterizedTest |
475 |
| - @ValueSource(strings = {"rgbChannelId", "dimmerAndRgbChannelId"}) |
476 |
| - @DisplayName("should send request to LedExecutor to change color to black") |
477 |
| - void turnOffRgbLights(String idFieldName) throws Exception { |
478 |
| - |
479 |
| - // given |
480 |
| - final int id = (int) FieldUtils.readDeclaredField(this, idFieldName, true); |
481 |
| - final ChannelUID channelUID = buildChannelUID(id, EXTRA_LIGHT_ACTIONS); |
482 |
| - final ChannelUID parentChannelUID = buildChannelUID(id); |
483 |
| - |
484 |
| - // when |
485 |
| - handler.handleStringCommand(channelUID, new StringType(OFF_LIGHT_COMMAND)); |
486 |
| - |
487 |
| - // then |
488 |
| - verify(ledCommandExecutor).changeColor(id, parentChannelUID, HSBType.BLACK); |
489 |
| - verify(callback).stateUpdated(parentChannelUID, HSBType.BLACK); |
490 |
| - } |
491 |
| - |
492 | 433 | @ParameterizedTest
|
493 | 434 | @ValueSource(strings = {"lightChannelId", "powerSwitchChannelId"})
|
494 | 435 | @DisplayName("should refresh light and set ON")
|
|
0 commit comments