--
You received this message because you are subscribed to the Google Groups "openhab" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/FoRAKv1AFmcJ.
To post to this group, send email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openhab+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openhab?hl=en.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
From my point of view changes are complite and they can be found from my close.
Also temprorary solution for issue 42 (http "cache") could be pulled to main repo if you accepted that.
21:36:31.546 DEBUG o.o.b.e.internal.ExecBinding[:135] - item 'Health_GF_Shutter_Test' is about to be refreshed now
21:36:31.547 INFO o.o.b.e.internal.ExecBinding[:381] - executed commandLine 'ping -c 1 127.0.0.1'
21:36:31.599 INFO o.o.b.e.internal.ExecBinding[:396] - exit code '0', result 'PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.100 ms
--- 127.0.0.1 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.100/0.100/0.100/0.000 ms
'
21:36:31.600 DEBUG o.o.c.t.i.s.RegExTransformationService[:62] - about to transform 'PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.100 ms
--- 127.0.0.1 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.100/0.100/0.100/0.000 ms
' by the function '.*transmitted, (.*?) received.*'
21:36:31.600 DEBUG o.o.b.e.internal.ExecBinding[:170] - transformed response is '1 packets'
21:36:31.601 INFO runtime.busevents[:46] - Health_GF_Shutter_Test state updated to 1 packets
21:36:31.602 DEBUG o.o.c.i.items.ItemUpdater[:93] - Received update of a not accepted type (StringType) for item Health_GF_Shutter_Test
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
private State createState(Class<? extends Item> itemType, String transformedResponse) {
try {
if (itemType.isAssignableFrom(DecimalType.class)) {
return DecimalType.valueOf(transformedResponse);
} else if (itemType.isAssignableFrom(OpenClosedType.class)) {
return OpenClosedType.valueOf(transformedResponse);
} else if (itemType.isAssignableFrom(OnOffType.class)) {
return OnOffType.valueOf(transformedResponse);
} else {
return StringType.valueOf(transformedResponse);
}
} catch (Exception e) {
logger.debug("Couldn't create state of type '{}' for value '{}'", itemType, transformedResponse);
return StringType.valueOf(transformedResponse);
}
}
private State createState(Class<? extends Item> itemType, String transformedResponse) { |
try { |
if (itemType.isAssignableFrom(NumberItem.class)) { |
return DecimalType.valueOf(transformedResponse); |
} else if (itemType.isAssignableFrom(ContactItem.class)) { |
return OpenClosedType.valueOf(transformedResponse); |
} else if (itemType.isAssignableFrom(SwitchItem.class)) { |
return OnOffType.valueOf(transformedResponse); |
} else { |
return StringType.valueOf(transformedResponse); |
} |
} catch (Exception e) { |
logger.debug("Couldn't create state of type '{}' for value '{}'", itemType, transformedResponse); |
return StringType.valueOf(transformedResponse); |
} |
} |
createState code was copied from http binding. Bug was recently fixed on http binding :(
Could you add me to the contributors?
--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openhab/e9c4546b-4671-4458-bca6-31d565c0921d%40googlegroups.com.Visit this group at http://groups.google.com/group/openhab.