Skip to content

Commit

Permalink
[transform.basicprofiles] Fixed spelling of threshold related variabl…
Browse files Browse the repository at this point in the history
…es (#108)

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
  • Loading branch information
cweitkamp authored and J-N-K committed May 20, 2021
1 parent c738260 commit 25f963f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class BasicProfilesFactory implements ProfileFactory, ProfileTypeProvider
public static final ProfileTypeUID GENERIC_TOGGLE_SWITCH_UID = new ProfileTypeUID(SCOPE, "toggle-switch");
public static final ProfileTypeUID INVERT_UID = new ProfileTypeUID(SCOPE, "invert");
public static final ProfileTypeUID ROUND_UID = new ProfileTypeUID(SCOPE, "round");
public static final ProfileTypeUID THRESHOLD_LOW_UID = new ProfileTypeUID(SCOPE, "threshold");
public static final ProfileTypeUID THRESHOLD_UID = new ProfileTypeUID(SCOPE, "threshold");

private static final ProfileType PROFILE_TYPE_GENERIC_COMMAND = ProfileTypeBuilder
.newTrigger(GENERIC_COMMAND_UID, "Generic Command") //
Expand All @@ -82,14 +82,13 @@ public class BasicProfilesFactory implements ProfileFactory, ProfileTypeProvider
.withSupportedItemTypes(CoreItemFactory.NUMBER) //
.withSupportedItemTypesOfChannel(CoreItemFactory.NUMBER) //
.build();
private static final ProfileType PROFILE_TYPE_THRESHOLD = ProfileTypeBuilder
.newState(THRESHOLD_LOW_UID, "Threshold") //
private static final ProfileType PROFILE_TYPE_THRESHOLD = ProfileTypeBuilder.newState(THRESHOLD_UID, "Threshold") //
.withSupportedItemTypesOfChannel(CoreItemFactory.DIMMER, CoreItemFactory.NUMBER) //
.withSupportedItemTypes(CoreItemFactory.SWITCH) //
.build();

private static final Set<ProfileTypeUID> SUPPORTED_PROFILE_TYPE_UIDS = Set.of(GENERIC_COMMAND_UID,
GENERIC_TOGGLE_SWITCH_UID, INVERT_UID, ROUND_UID, THRESHOLD_LOW_UID);
GENERIC_TOGGLE_SWITCH_UID, INVERT_UID, ROUND_UID, THRESHOLD_UID);
private static final Set<ProfileType> SUPPORTED_PROFILE_TYPES = Set.of(PROFILE_TYPE_GENERIC_COMMAND,
PROFILE_TYPE_GENERIC_TOGGLE_SWITCH, PROFILE_TYPE_INVERT, PROFILE_TYPE_ROUND, PROFILE_TYPE_THRESHOLD);

Expand All @@ -116,7 +115,7 @@ public BasicProfilesFactory(final @Reference ProfileTypeI18nLocalizationService
return new InvertStateProfile(callback);
} else if (ROUND_UID.equals(profileTypeUID)) {
return new RoundStateProfile(callback, context);
} else if (THRESHOLD_LOW_UID.equals(profileTypeUID)) {
} else if (THRESHOLD_UID.equals(profileTypeUID)) {
return new ThresholdStateProfile(callback, context);
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
package org.smarthomej.transform.basicprofiles.internal.profiles;

import static org.smarthomej.transform.basicprofiles.internal.factory.BasicProfilesFactory.THRESHOLD_LOW_UID;
import static org.smarthomej.transform.basicprofiles.internal.factory.BasicProfilesFactory.THRESHOLD_UID;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.library.types.OnOffType;
Expand Down Expand Up @@ -50,7 +50,7 @@ public ThresholdStateProfile(ProfileCallback callback, ProfileContext context) {

@Override
public ProfileTypeUID getProfileTypeUID() {
return THRESHOLD_LOW_UID;
return THRESHOLD_UID;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ profile.config.basic-profiles.round.scale.description = Scale to indicate the re
profile.config.basic-profiles.round.mode.label = Rounding Mode
profile.config.basic-profiles.round.mode.description = Rounding mode to be used (UP, DOWN, CEILING, FLOOR, HALF_UP or HALF_DOWN).

profile-type.basic-profiles.treshold.label = Threshold
profile.config.basic-profiles.treshold.threshold.label = Threshold
profile.config.basic-profiles.treshold.threshold.description = Triggers ON if value is below the given threshold, otherwise OFF.
profile-type.basic-profiles.threshold.label = Threshold
profile.config.basic-profiles.threshold.threshold.label = Threshold
profile.config.basic-profiles.threshold.threshold.description = Triggers ON if value is below the given threshold, otherwise OFF.

0 comments on commit 25f963f

Please sign in to comment.