Skip to main content



      Home
Home » Archived » Eclipse SmartHome » Posting custom command types on the event bus
Posting custom command types on the event bus [message #1734700] Fri, 10 June 2016 08:14 Go to next message
Eclipse UserFriend
I am developing a binding and I have created a custom command type (i.e. implements Command and State). When I post a new ItemCommandEvent (created using the ItemEventFactory) on the EventBus I get a ClassNotFoundException because the ItemEventFactory calls Class<?>.forname() and passes in a path to the type using concatenation of the Command name and the hard-coded string "org.eclipse.smarthome.core.library.types", however my Command class is in my package, not in the core.library.type package.

It would appear from this that the ItemEventFactory expects all commands to be of the core type and cannot be used to post events with custom command types. Is it intended that developers are able to create custom commands, and if so what is the preferred method of posting ItemCommandEvents with them, given that a factory is needed to create the Event?


Re: Posting custom command types on the event bus [message #1735357 is a reply to message #1734700] Fri, 17 June 2016 11:33 Go to previous message
Eclipse UserFriend
> Is it intended that developers are able to create custom commands

This was once the idea in openHAB 1, but we actually reverted this idea as it had all kinds of issues (like the one you describe). So as a matter of fact, only core command types exist. If people want to do something very specific, they usually fall back to String commands and build their own interpretation on top of it.

What command type would you like to introduce? Is it something that should be considered to add to the core types for everyone?

Regards,
Kai
Previous Topic:How to know when the an UI is used
Next Topic:Dynamically created channels are not shown
Goto Forum:
  


Current Time: Wed Jul 16 21:53:11 EDT 2025

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

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

Back to the top