openhab / org.openhab.ui.habpanel

OUTDATED repo - HABPanel has moved to the openhab-webui repo!
https://github.com/openhab/openhab-webui
Eclipse Public License 1.0
97 stars 93 forks source link

New Keypad Widget #104

Open MikeMurpher opened 7 years ago

MikeMurpher commented 7 years ago

I recently uploaded a widget template to the openHAB community for a keypad interface.

I was interested to learn how the backend of HABpanel functioned and also looked to if I could design the keypad widget in the backend code rather then just template due to limitations on script code.

I now have a functioning keypad code widget that I think I can now build upon to add more features too.

I'm just looking to see if you think it is of interest for the master branch. I also see there is an issue for pin security specifically for the whole HABpanel although this offers a stepping stone to at least offer security over 'features' of the users system.

Keypad currently has set background-color, set a max char input Limit and an auto clearing of entered numbers if the user doesn't clear or hit enter(resets to 5 seconds on each key press).

https://github.com/Murpher/org.openhab.ui.habpanel

keypad

Please let me know what you think It would be nice to contribute something back.

ghys commented 7 years ago

Hi Mike,

I already gave your keypad as a custom widget a try and let me say, it is already remarkable what you managed to achieve without custom code!

First, I'd just like to ask for your patience before considering such a potential pull request for inclusion, because as openHAB 2 is reaching its big release, I've decided to postpone adding brand new features for the time being and focus on stabilization of the current feature set instead.

As for it being relevant to be included in as a built-in widget, I actually believe it does ;) For a new widget to be bundled in for everyone, I think it comes down to this: is it useful in specific scenarios only - then it should be packaged as a custom widget for those who need it to download separately -, or is it "universally" useful for many use cases, generic enough to not being tied to a specific configuration/binding and not "forcing" a paticular layout or design to all users (a built-in widget can only be altered with configuration, whereas the custom widget can be modified to suit one's tastes).

With that in mind, I think your keypad widget does make perfect in a home automation dashboard, for openHAB-based alarm systems obviously, but also indeed for general "protection" (#81, and also pin-protected switches and whatnot). As I've said elsewhere, it's important to realize we're not talking about real security here because we're in a client scenario consuming a mostly unprotected API, but I guess it's okay and still valuable if it's understood by users.

What I'd like to achieve is to able to make it useful in other parts of HABPanel (with a <widget-keypad /> element), and users should also be able to include it in their templates or custom widgets - if they design a more complete one for their alarm system for instance. So I believe it should be able to do more than send the PIN to an item, though this should remain one of the simpler use cases.

In summary, I'd suggest waiting for openHAB 2 general availability, and then we can discuss how best to proceed.

Many thanks already for your contribution and your understanding!

MikeMurpher commented 7 years ago

Hi Yannick,

Thank you for time and response. Delighted to read your feed back and understand time for patience.

Look forward when the time is right to proceed.

Thanks

gersilex commented 7 years ago

Just a design idea: Could the number keys stretch to fill the whole

vertically? There is much space below the keypad and I would like to have the buttons square-ish.

kirantpatil commented 7 years ago

@Murpher,

Good news, you can build it as global widget and push it to marketplace.