openhab/openhab — pull request #1658 by bhelm (2014-11-14 01:30:51+00:00)
Title: Max!Cube binding: new exclusive mode, send only events if values really changed

I wanted to use the Max!Cube to react on window-contact-events more instantly (Like door open -> light on). This was not possible with a 10s poll rate and the original binding is not able to get much faster, as it opens a connection on every poll and parses a lot of configuration options, which causes much load on openhab with higher poll rates.
The new optional exclusive mode solves these problems: it opens the connection once and requests the live-data multiple times, which is more efficient. Also, the original binding sent every polled state to the event bus, causing log messages of changed values that are still the same as before. With higher poll rates, this spammed the console a lot, so i fixed this too. Also some simplifications and improvements were made here and there.
I have tested my code in the last five days and it is running the last 48 hours nonstop with a 300ms poll rate without problems. Im running it on armv7h with oracle-java. my full openhab setup is consuming on average 7% of the 1ghz cpu.

i also added the config options to the default config including a discription of their effects. I would also add some info to the wiki page if this gets merged. Hopefully my code will meet the quality requirements, as im not very expirienced in java programming.

Thank You.