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

[map] Transformation language not working #14823

Closed
florian-h05 opened this issue Apr 16, 2023 · 1 comment · Fixed by #14825
Closed

[map] Transformation language not working #14823

florian-h05 opened this issue Apr 16, 2023 · 1 comment · Fixed by #14825
Assignees
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@florian-h05
Copy link
Contributor

florian-h05 commented Apr 16, 2023

Expected Behavior

language is used to select transformations based on locales. You could have a transformation "switch" which depending on the locale translated ON to different values. This is also available in file-based transformations by adding a _de suffix to the filename (before the extension).

Originally posted by @J-N-K in openhab/openhab-webui#1448 (comment)

So if you have foo_en.script and a foo_de.script (or the corresponding managed UIDs), base on the locale either the first or the second is used when you configure SCRIPT(foo.script):%s.

Originally posted by @J-N-K in openhab/openhab-webui#1448 (comment)

Current Behavior

I have these transformations:

  • files
    • switch_de.map
    • switch_en.map
  • UI
    • config:map:switch:de
    • config:map:switch:en

Using MAP(switch.map) or MAP(config:map:switch) for Item states does not work and leads to:

Failed transforming the state 'OFF' on item 'test_switch' with pattern 'MAP(switch.map):%s': Could not find configuration 'switch.map' or failed to parse it.

Steps to Reproduce (for Bugs)

See above.

Context

I have discovered this while working on the UI transformation menu & editor.
If this is still supported, the UI needs a minor adjustment for the tip how to use that transformation.

Your Environment

  • Version used: SNAPSHOT openhab/openhab-core#3415
  • Environment name and version: Chrome 112
  • Operating System and version: Fedora 36
@florian-h05 florian-h05 added the bug An unexpected problem or unintended behavior of an add-on label Apr 16, 2023
@J-N-K J-N-K transferred this issue from openhab/openhab-core Apr 16, 2023
@J-N-K J-N-K self-assigned this Apr 16, 2023
@J-N-K J-N-K changed the title Transformation language not working [map] Transformation language not working Apr 16, 2023
@florian-h05
Copy link
Contributor Author

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants