Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » label taken from channel-type and not from overwritten channel definition
label taken from channel-type and not from overwritten channel definition [message #1781136] Thu, 01 February 2018 19:56 Go to next message
Arne Plöse is currently offline Arne PlöseFriend
Messages: 4
Registered: February 2018
Junior Member
Hi,

I'm developing a new binding.
I have a channel-type in channels.xml:
<channel-type id="switchTimes">
<item-type>String</item-type>
<label>Switch Time</label>
<description>Switch times of Mon-Sun format: "XX:XX-XX:XX XX:XX-XX:XX".</description>
<category>Radiator</category>
</channel-type>

and I override this in radiator-fht80b.xml

<channel id="mondaySwitchTimes" typeId="switchTimes">
<label>Monday</label>
</channel>
<channel id="tuesdaySwitchTimes" typeId="switchTimes">
<label>Tuesday</label>
</channel>
<channel id="wednesdaySwitchTimes" typeId="switchTimes">
<label>Wednesday</label>
</channel>
<channel id="thursdaySwitchTimes" typeId="switchTimes">
<label>Thursday</label>
</channel>
<channel id="fridaySwitchTimes" typeId="switchTimes">
<label>Friday</label>
</channel>
<channel id="saturdaySwitchTimes" typeId="switchTimes">
<label>Saturday</label>
</channel>
<channel id="sundaySwitchTimes" typeId="switchTimes">
<label>Sunday</label>
</channel>

Using simple Mode for Item binding The Items will be named with the correct Weekdays - but using manual binding the item name will contain SwitchTime.

As a start I'm looking for the point in the source code where the new Item name is prepared, because GenericItem gets created with the wrong name.
Re: label taken from channel-type and not from overwritten channel definition [message #1781159 is a reply to message #1781136] Fri, 02 February 2018 08:29 Go to previous messageGo to next message
Simon Kaufmann is currently offline Simon KaufmannFriend
Messages: 51
Registered: January 2011
Member
What exactly do you mean by "using manual binding"? How do you do it? Via Paper UI? Via *.item file? Please precisely describe what steps are needed in order to reproduce it, otherwise it's quite hard to guess...
Re: label taken from channel-type and not from overwritten channel definition [message #1781255 is a reply to message #1781159] Mon, 05 February 2018 07:02 Go to previous message
Arne Plöse is currently offline Arne PlöseFriend
Messages: 4
Registered: February 2018
Junior Member
I'm using Paper UI
Make sure Configuration > System > Item Linking > Simple Mode is disabled.

1. In Configuration > Things > "ThingName" > "ChannelName" press the empty circle of said channel ("Tuesday").
2. In the dialogbox select "+Create new item".
3. In the now opened dialogbox "Link channel" the
name will be "FHT80b202_SwitchTime" and the
label will be "Switch Time".

If I had the channel with id="tuesdaySwitchTimes" I would expect to have as
name "FHT80b202_Tuesday" and as
label "Tuesday".

OK Im scanned the paperUI sources.
in /org.eclipse.smarthome.ui.paper/web-src/js/controllers/controller.things.view.js
in line 79: $scope.linkChannel = function(channelID, event, preSelect) {

In this function suggestedLabel is taken from the channeltype instead from the channel.
And the result of getItemNameSuggestion is also from channelType.

[Updated on: Mon, 05 February 2018 08:46]

Report message to a moderator

Previous Topic:Trying to add a new item to a registry through API
Next Topic:HOW TO GET BACK THE STATE OF AN ITEM
Goto Forum:
  


Current Time: Fri Dec 06 14:59:22 GMT 2024

Powered by FUDForum. Page generated in 0.03348 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top