From 25f963f89f71fc7456b096d59d237b08385a8c2a Mon Sep 17 00:00:00 2001 From: Christoph Weitkamp Date: Thu, 20 May 2021 15:56:07 +0200 Subject: [PATCH] [transform.basicprofiles] Fixed spelling of threshold related variables (#108) Signed-off-by: Christoph Weitkamp --- .../internal/factory/BasicProfilesFactory.java | 9 ++++----- .../internal/profiles/ThresholdStateProfile.java | 4 ++-- .../main/resources/OH-INF/i18n/basicprofiles.properties | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/bundles/org.smarthomej.transform.basicprofiles/src/main/java/org/smarthomej/transform/basicprofiles/internal/factory/BasicProfilesFactory.java b/bundles/org.smarthomej.transform.basicprofiles/src/main/java/org/smarthomej/transform/basicprofiles/internal/factory/BasicProfilesFactory.java index 40006fa908..bbb49d0e9b 100644 --- a/bundles/org.smarthomej.transform.basicprofiles/src/main/java/org/smarthomej/transform/basicprofiles/internal/factory/BasicProfilesFactory.java +++ b/bundles/org.smarthomej.transform.basicprofiles/src/main/java/org/smarthomej/transform/basicprofiles/internal/factory/BasicProfilesFactory.java @@ -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") // @@ -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 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 SUPPORTED_PROFILE_TYPES = Set.of(PROFILE_TYPE_GENERIC_COMMAND, PROFILE_TYPE_GENERIC_TOGGLE_SWITCH, PROFILE_TYPE_INVERT, PROFILE_TYPE_ROUND, PROFILE_TYPE_THRESHOLD); @@ -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; diff --git a/bundles/org.smarthomej.transform.basicprofiles/src/main/java/org/smarthomej/transform/basicprofiles/internal/profiles/ThresholdStateProfile.java b/bundles/org.smarthomej.transform.basicprofiles/src/main/java/org/smarthomej/transform/basicprofiles/internal/profiles/ThresholdStateProfile.java index e68fa5c70f..500c45eeeb 100644 --- a/bundles/org.smarthomej.transform.basicprofiles/src/main/java/org/smarthomej/transform/basicprofiles/internal/profiles/ThresholdStateProfile.java +++ b/bundles/org.smarthomej.transform.basicprofiles/src/main/java/org/smarthomej/transform/basicprofiles/internal/profiles/ThresholdStateProfile.java @@ -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; @@ -50,7 +50,7 @@ public ThresholdStateProfile(ProfileCallback callback, ProfileContext context) { @Override public ProfileTypeUID getProfileTypeUID() { - return THRESHOLD_LOW_UID; + return THRESHOLD_UID; } @Override diff --git a/bundles/org.smarthomej.transform.basicprofiles/src/main/resources/OH-INF/i18n/basicprofiles.properties b/bundles/org.smarthomej.transform.basicprofiles/src/main/resources/OH-INF/i18n/basicprofiles.properties index d72a5f863a..b9c6982a55 100644 --- a/bundles/org.smarthomej.transform.basicprofiles/src/main/resources/OH-INF/i18n/basicprofiles.properties +++ b/bundles/org.smarthomej.transform.basicprofiles/src/main/resources/OH-INF/i18n/basicprofiles.properties @@ -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.