Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » NextPreviousType/UpDownType
NextPreviousType/UpDownType [message #1755198] Wed, 01 March 2017 02:38 Go to next message
Tim Roberts is currently offline Tim RobertsFriend
Messages: 29
Registered: September 2016
Junior Member
I'm implementing the media management function in Russound (to eventually create a nice habpanel template to control it). I have a few channels that need a previous/next (previous screen, next screen, previous menu item, next menu item) or an up/down (letter up, letter down) type of command.

Looking at the code - there is a PreviousNextType and UpDownType - which is perfect for my needs.

However - when I get to the thing-types.xml channel definition - I'm at a loss as to what to put as the item-type.

Looks like the PreviousNextType is ONLY accepted by the PlayerItem and UpDownType is ONLY accepted by the RollershutterItem.

I don't want to use item types of "player" or "rollershutter" because it's obviously not even close to what the channels are.

Is their any solution to that? Seems like I'm going to have to back off of using both those types and just do StringTypes (and validate the content)?

Any suggestions or alternative approaches I'm unaware of?
Re: NextPreviousType/UpDownType [message #1755486 is a reply to message #1755198] Fri, 03 March 2017 17:07 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
Nope. The most straight forward approach is to use a StringItem and you simply define the strings that correspond to your commands.
Re: NextPreviousType/UpDownType [message #1774587 is a reply to message #1755486] Tue, 17 October 2017 14:43 Go to previous messageGo to next message
Nils Billing is currently offline Nils BillingFriend
Messages: 13
Registered: September 2017
Junior Member
perhaps you can you help me with my example?

that's defintion of my channel:
    <channel-type id="zoom-channel">
        <item-type>String</item-type>
        <label>Zoom</label>
        <description>Zooming</description>
        <state>
            <options>
                <option value="IN">in</option>
                <option value="OUT">out</option>
            </options>
        </state>
    </channel-type>


Now I have a drop down with the two options 'in' and 'out' on PaperUI. I can select an option and it will be handled by the ThingHandler but then this option is now selected in the dropdown and I can't select it again until I select the other option. The result is I can zoom in one step but I can't zoom in one step again because I've to zoom out first...

How can I reset the dropdown to nothing? Or is there a possibility to show two pushbuttons like '+' and '-' for zooming which are stateless.
Re: NextPreviousType/UpDownType [message #1775432 is a reply to message #1774587] Mon, 30 October 2017 08:45 Go to previous message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
> How can I reset the dropdown to nothing?

You have to deactivate the autoupdate on this item. This is currently done by adding { autoupdate="false" } in your items-file. We are working on a mechanism that allows bindings to directly suggest to turn it off for a specific channel (see https://github.com/eclipse/smarthome/issues/595), I guess this is what would be the best solution for your case.

> Or is there a possibility to show two pushbuttons like '+' and '-' for zooming which are stateless.

For the Basic UI you can use "Switch" widgets with "mapping" information - this will render dedicated buttons for your commands (see http://docs.openhab.org/configuration/sitemaps.html#element-type-switch).
Previous Topic:Install extension via /extensions/url/{url}/install REST API
Next Topic:HTTP ERROR 404
Goto Forum:
  


Current Time: Sat Apr 27 02:11:15 GMT 2024

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

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

Back to the top