Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve description of hysteresis bounds #4149

Merged
merged 3 commits into from Apr 7, 2024
Merged

Improve description of hysteresis bounds #4149

merged 3 commits into from Apr 7, 2024

Conversation

ArXa1L
Copy link
Contributor

@ArXa1L ArXa1L commented Mar 14, 2024

Hello,
I found that hysteresis value mapping works differently than stated in its documentation:

source:

    private Type mapValue(double lower, double upper, double value) {
        if (value <= lower) {
            return low;
        } else if (value >= upper) {
            return high;
        }
        return previousType;
    }

doc:

<parameter name="lower" type="text" required="true">
  <label>Lower Bound</label>
  <description>Maps to OFF if value is below lower bound (plain number or number with unit).</description>
</parameter>
<parameter name="upper" type="text">
  <label>Upper Bound</label>
  <description>Maps to ON if value is above upper bound (plain number or number with unit).</description>
</parameter>

I thought that changing the value mapping would be more correct and opened PR #4120, but during the discussion we decided that it would be preferable to improve the documentation

@ArXa1L ArXa1L requested a review from a team as a code owner March 14, 2024 14:42
Signed-off-by: Denis Tarasov <dstarasov@skbkontur.ru>
Signed-off-by: Denis Tarasov <dstarasov@skbkontur.ru>
Copy link
Contributor

@seime seime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In SystemProfiles_XX.properties, these texts are translated to 15-20 languages. These are not adjusted accordingly, but it might be hard for the contributor to do so.

@@ -5,9 +5,9 @@ profile.config.system.offset.offset.label = Смещение
profile.config.system.offset.offset.description = Смещение (просто число или с ед. измерения), применяемое к состоянию по отношению к элементу. Отрицательное смещение будет применено в обратном направлении.
profile-type.system.hysteresis.label = Гистерезис
profile.config.system.hysteresis.lower.label = Нижняя граница
profile.config.system.hysteresis.lower.description = Приводит к состоянию OFF, если значение меньше нижней границы (просто число или с ед. измерения).
profile.config.system.hysteresis.lower.description = Приводит к состоянию OFF, если значение меньше или равно нижней границе (просто число или с ед. измерения).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove these translations (only keep the XML changes and the English) and add it later using crowdin. Otherwise it'll not show up there.

Copy link
Member

@J-N-K J-N-K left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@J-N-K J-N-K merged commit cbb458e into openhab:main Apr 7, 2024
3 checks passed
@J-N-K J-N-K added the enhancement An enhancement or new feature of the Core label Apr 7, 2024
@J-N-K J-N-K added this to the 4.2 milestone Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants