Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Item Label using only Map Transformation fails #2371

Closed
J-N-K opened this issue Oct 30, 2016 · 8 comments
Closed

Item Label using only Map Transformation fails #2371

J-N-K opened this issue Oct 30, 2016 · 8 comments

Comments

@J-N-K
Copy link
Contributor

J-N-K commented Oct 30, 2016

An item defined in a .items file with a label using a MAP transformation

String Feiertag_Name "[MAP(holidays_de.map):%s]"

leads to

2016-10-30 13:07:24.043 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type MMAP 2016-10-30 13:07:24.044 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - couldn't transform value in label because transformationService of type 'MMAP' is unavailable

(note that the M is doubled to MMAP) while

String Feiertag_Name "Test [MAP(holidays_de.map):%s]"

works fine. (OH 2.0.0b4)

@ThomDietrich
Copy link
Contributor

Confirmed with latest snapshot.

@bdleedy
Copy link

bdleedy commented Dec 7, 2016

Workaround is a space in front of [, but I can confirm this issue.

@ThomDietrich
Copy link
Contributor

ThomDietrich commented Dec 7, 2016

An item should always have a label. If you want your sitemap to not show a label, define label="[%s]" for the corresponding element there.

Maintainers: This is a bug. It should be either supported or forbidden to have no label defined for an item. The "MMAP" error is clearly a bug in the evaluation algorithm.

@bdleedy
Copy link

bdleedy commented Dec 7, 2016

If I take a String in items and then in the sitemap have Text item=thatstring, the label for the sitemap element is on the left and the label for the item is on the right. That doesn't blank the items label.

@ThomDietrich
Copy link
Contributor

ThomDietrich commented Dec 7, 2016

I believe you got me wrong?

# item
String KodiTitle "Episode/Movie Title [%s]" (gKodi) {xbmc="<[#livingRoom|Player.Title]"}

#sitemap
Text item=KodiTitle label="[%s]" icon="kodilogo"

@bdleedy
Copy link

bdleedy commented Dec 7, 2016

Yeah, that's exactly what I'm talking about. So with that config, nothing would be on the left but "Episode..." would be on the right.

@ThomDietrich
Copy link
Contributor

ThomDietrich commented Dec 7, 2016

Sorry, of course the value placeholder has to be in there. With the corrected example above:

grafik

Ah and because you confused me earlier: "Episode/Movie Title" (item) respectively "" (sitemap) are called label while "Just to Get a Rep" is called the value of an item.

maggu2810 pushed a commit that referenced this issue Jan 8, 2017
issue #2371

Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
@ThomDietrich
Copy link
Contributor

ThomDietrich commented Jan 8, 2017

Thanks @J-N-K and @maggu2810

chaton78 pushed a commit to chaton78/smarthome that referenced this issue May 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants