mcjobo/openhab — pull request #1 by Roadyweb (2014-12-30 14:02:29+00:00)
Title: Log bitshuffling fixes

Hi McJobo,

thanks for your work. With exeception of the serial port string ("port" instead of "serialPort") I had no problems to work with your module. This pull request includes some minor improvements to the log file readability (dismiss messages with CRC errors, remove \r\n from logged messages). Also I found that your code had some bugs in it when it came to the bit shuffling (MsgGrp=10 MsgId=1 wasn't decoded correctly). I think I found a more readable solution which also fixes the problem.
Additionally I've added the test cases for all messages I've tried in real life (generic version, generic battery, weather temperature ....)
The following items work as expected:

```
Number luftfeuchtigkeit "Humidity [%.1f %%]" (gGF) {smarthomatic="<[deviceId=10, messageGroupId=10, messageId=2, messagePart=0:JS(getDiv10.js)]"}
Number temperatur "Temperature [%.1f °C]" (gGF) {smarthomatic="<[deviceId=10, messageGroupId=10, messageId=2, messagePart=1:JS(getDiv100.js)]"}
Number temperaturalt "TemperatureAlt [%.1f °C]" (gGF) {smarthomatic="<[deviceId=10, messageGroupId=10, messageId=1, messagePart=0:JS(getDiv100.js)]"}
Number helligkeit "Brightness [%d]" (gGF) {smarthomatic="<[deviceId=10, messageGroupId=11, messageId=1]"}
Number batterie "Batterie [%d]" (gGF) {smarthomatic="<[deviceId=10, messageGroupId=0, messageId=5]"}
Number version_major "Version_Major [%d]" (gGF) {smarthomatic="<[deviceId=10, messageGroupId=0, messageId=1, messagePart=0]"}
Number version_minor "Version_Minor [%d]" (gGF) {smarthomatic="<[deviceId=10, messageGroupId=0, messageId=1, messagePart=1]"}
Number version_patch "Version_Patch [%d]" (gGF) {smarthomatic="<[deviceId=10, messageGroupId=0, messageId=1, messagePart=2]"}
Number version_hash "Version_Hash [%d]" (gGF) {smarthomatic="<[deviceId=10, messageGroupId=0, messageId=1, messagePart=3]"}

Number temperatur2 "Temperature2 [%.1f °C]" (gGF) {smarthomatic="<[deviceId=11, messageGroupId=10, messageId=1, messagePart=0:JS(getDiv100.js)]"}
Number luftdruck2 "Luftdruck2 [%.1f hPa]" (gGF) {smarthomatic="<[deviceId=11, messageGroupId=10, messageId=3, messagePart=0:JS(getDiv100.js)]"}
Number abstand2 "Abstand2 [%.1f cm]" (gGF) {smarthomatic="<[deviceId=11, messageGroupId=11, messageId=2, messagePart=0]"}
Number batterie2 "Batterie2 [%d]" (gGF) {smarthomatic="<[deviceId=11, messageGroupId=0, messageId=5]"}
Number version_major2 "Version_Major2 [%d]" (gGF) {smarthomatic="<[deviceId=11, messageGroupId=0, messageId=1, messagePart=0]"}
Number version_minor2 "Version_Minor2 [%d]" (gGF) {smarthomatic="<[deviceId=11, messageGroupId=0, messageId=1, messagePart=1]"}
Number version_patch2 "Version_Patch2 [%d]" (gGF) {smarthomatic="<[deviceId=11, messageGroupId=0, messageId=1, messagePart=2]"}
Number version_hash2 "Version_Hash2 [%d]" (gGF) {smarthomatic="<[deviceId=11, messageGroupId=0, messageId=1, messagePart=3]"}
```
I'm also still working on the git work flow, if anything doesn't work as expected just let me know.

Best regards,
rr2000