tronghuyict56 / openhab

Automatically exported from code.google.com/p/openhab
0 stars 0 forks source link

nh-binding can not be used for String-Items #301

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

The following entry in xxx.items
Switch speedport                "Speedport W 900 V"             <network>       
(Netzwerk)              { nh="speedport" }

causes this runtime error:
osgi> 17:00:42.787 ERROR o.o.m.i.i.GenericItemProvider[:226] - Binding 
information of type 'nh' for item ‘speedport‘ could not be parsed correctly.
org.openhab.model.item.binding.BindingConfigParseException: item 'speedport' is 
of type 'StringItem', only Switch- and StringItems are allowed - please check 
your *.items configuration
        at org.openhab.binding.networkhealth.internal.NetworkHealthGenericBindingProvider.validateItemType(NetworkHealthGenericBindingProvider.java:71)

=> According to the error message a string item is allowed, but according to 
the source code (NetworkHealthGenericBindingProvider.java) it is not allowed:

    public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException {         
            if (!(item instanceof SwitchItem)) {
                     throw new BindingConfigParseException("item '" + item.getName()
                                 + "' is of type '" + item.getClass().getSimpleName()
                                 + "', only Switch- and StringItems are allowed - please check your *.items configuration");
            }
     }

What is the expected output? What do you see instead?
String items should also work with nh-bindigns

What version of the product are you using? On what operating system?
Openhab 1.2 on Debian Linux 6.0.5

Please provide any additional information below.

Original issue reported on code.google.com by thomas.h...@gmail.com on 14 May 2013 at 7:20

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago

Original comment by teichsta on 23 May 2013 at 3:50

GoogleCodeExporter commented 8 years ago
fixed with 
http://code.google.com/p/openhab/source/detail?r=494de5d4b6c27ad0f13e45614844f76
5dc59f3be

Original comment by teichsta on 26 May 2013 at 11:07