Skip to content

Commit

Permalink
Add missing system profile types and UIDs (#4320)
Browse files Browse the repository at this point in the history
* Add missing system profile types and UIDs

Signed-off-by: Jan N. Klug <[email protected]>
  • Loading branch information
J-N-K authored Jul 16, 2024
1 parent f631f1b commit 6f0add0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ public class SystemProfileFactory implements ProfileFactory, ProfileAdvisor, Pro
RAWROCKER_NEXT_PREVIOUS_TYPE, RAWROCKER_ON_OFF_TYPE, RAWROCKER_PLAY_PAUSE_TYPE,
RAWROCKER_REWIND_FASTFORWARD_TYPE, RAWROCKER_STOP_MOVE_TYPE, RAWROCKER_UP_DOWN_TYPE,
TRIGGER_EVENT_STRING_TYPE, TIMESTAMP_CHANGE_TYPE, TIMESTAMP_OFFSET_TYPE, TIMESTAMP_TRIGGER_TYPE,
TIMESTAMP_UPDATE_TYPE);
TIMESTAMP_UPDATE_TYPE, BUTTON_TOGGLE_SWITCH_TYPE, BUTTON_TOGGLE_PLAYER_TYPE,
BUTTON_TOGGLE_ROLLERSHUTTER_TYPE);

private static final Set<ProfileTypeUID> SUPPORTED_PROFILE_TYPE_UIDS = Set.of(DEFAULT, FOLLOW, HYSTERESIS, OFFSET,
RANGE, RAWBUTTON_ON_OFF_SWITCH, RAWBUTTON_TOGGLE_PLAYER, RAWBUTTON_TOGGLE_ROLLERSHUTTER,
RAWBUTTON_TOGGLE_SWITCH, RAWROCKER_DIMMER, RAWROCKER_NEXT_PREVIOUS, RAWROCKER_ON_OFF, RAWROCKER_PLAY_PAUSE,
RAWROCKER_REWIND_FASTFORWARD, RAWROCKER_STOP_MOVE, RAWROCKER_UP_DOWN, TRIGGER_EVENT_STRING,
TIMESTAMP_CHANGE, TIMESTAMP_OFFSET, TIMESTAMP_TRIGGER, TIMESTAMP_UPDATE);
TIMESTAMP_CHANGE, TIMESTAMP_OFFSET, TIMESTAMP_TRIGGER, TIMESTAMP_UPDATE, BUTTON_TOGGLE_SWITCH,
BUTTON_TOGGLE_PLAYER, BUTTON_TOGGLE_ROLLERSHUTTER);

private final Map<LocalizedKey, ProfileType> localizedProfileTypeCache = new ConcurrentHashMap<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,14 @@ public interface SystemProfiles {

ProfileType TIMESTAMP_UPDATE_TYPE = ProfileTypeBuilder.newState(TIMESTAMP_UPDATE, "Timestamp on update")
.withSupportedItemTypes(CoreItemFactory.DATETIME).build();

ProfileType BUTTON_TOGGLE_SWITCH_TYPE = ProfileTypeBuilder.newTrigger(BUTTON_TOGGLE_SWITCH, "Toggle Switch")
.withSupportedItemTypes(CoreItemFactory.SWITCH).build();

ProfileType BUTTON_TOGGLE_PLAYER_TYPE = ProfileTypeBuilder.newTrigger(BUTTON_TOGGLE_PLAYER, "Toggle Player")
.withSupportedItemTypes(CoreItemFactory.PLAYER).build();

ProfileType BUTTON_TOGGLE_ROLLERSHUTTER_TYPE = ProfileTypeBuilder
.newTrigger(BUTTON_TOGGLE_ROLLERSHUTTER, "Toggle Rollershutter")
.withSupportedItemTypes(CoreItemFactory.ROLLERSHUTTER).build();
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void beforeEach() {
@Test
public void systemProfileTypesAndUidsShouldBeAvailable() {
Collection<ProfileTypeUID> systemProfileTypeUIDs = profileFactory.getSupportedProfileTypeUIDs();
assertThat(systemProfileTypeUIDs, hasSize(21));
assertThat(systemProfileTypeUIDs, hasSize(24));

Collection<ProfileType> systemProfileTypes = profileFactory.getProfileTypes(null);
assertThat(systemProfileTypes, hasSize(systemProfileTypeUIDs.size()));
Expand Down

0 comments on commit 6f0add0

Please sign in to comment.