这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on May 17, 2021. It is now read-only.

Conversation

@wborn
Copy link
Member

@wborn wborn commented Aug 13, 2016

My implementation for this enhancement (#4565) has been working fine for several weeks now so here is the pull request.

wborn added 2 commits August 4, 2016 22:57
Adds support to the Plugwise binding for:
* Scan
* Sense
* Stealth
* Switch

Signed-off-by: Wouter Born <github@maindrain.net> (github: wborn)
* Clean up code and made code clearer
* Added Plugwise device type to openhab_default.cfg

Signed-off-by: Wouter Born <github@maindrain.net> (github: wborn)
@wborn wborn changed the title Add support for Scan, Sense, Stealth and Switch #4565 [Plugwise] Add support for Scan, Sense, Stealth and Switch #4565 Aug 13, 2016
setupNonStickDevices(config);
setProperlyConfigured(true);
} else {
logger.error("Plugwise needs at least one Stick in order to operate");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be better as a logger.warn, since logger.error is reserved for messages that affect system stability.

@watou
Copy link
Contributor

watou commented Aug 14, 2016

Hi @wborn, thanks for this. Please see my minor comments inline. I'm also curious about the frequent use of DATE_TIME_FORMATTER for handling dates and times as Strings, instead of using a more efficient and complete interim type like Calendar. I know you weren't the first to do that in this binding, but it seems inefficient and might lose information in translation. Any thoughts about that?

Are there any users of the binding on the community forum who might be interested in trying a test JAR based on this PR to get the added features and verify no regressions? What updates to the wiki page would be needed to introduce the new features? Lastly, thanks for improving variable and member names as you did; always nice to bring things back to more common conventions.

* Reworked log levels
* Improved posting state updates by using objects instead of needless String serialization/deserialization

Signed-off-by: Wouter Born <github@maindrain.net> (github: wborn)
@wborn
Copy link
Member Author

wborn commented Aug 14, 2016

Thanks for having a look at the code @watou .

The log levels have been tuned now.

Also I had a look at those formatters. Apparently all device updates were first serialized to Strings and then again deserialized in to objects in PlugwiseBinding.postUpdate . It should now directly use the objects. That should save CPU cycles and improve the accuracy of all timestamps.

Calendar objects are now used for tracking simple timestamps. I've kept the Joda DateTime objects for the calculation logic because changing that could cause regressions.

I'll soon update the JAR in the enhancement issue and community thread .

The wiki should be updated so it covers:

  • device type configuration in openhab.cfg
  • descriptions of the item configuration options
  • examples of confuring Scan, Sense, Switch items

All this information is already available in the enhancement issue. I can have a look at the wiki as well. Though there is a bit of a chicken/egg problem when the functionality is not yet merged or available in a stable release.

@watou
Copy link
Contributor

watou commented Aug 14, 2016

Thanks very much, @wborn. Please let me know when it seems like others have validated your changes with the test JAR, and I will merge this PR thereafter!

@wborn
Copy link
Member Author

wborn commented Sep 14, 2016

Looks like no new issues were introduced after others validated the changes with the test JAR. Could you please merge this PR @watou ? I'll then create a new PR to get the updated Plugwise Binding in OH2.

@watou watou merged commit c560485 into openhab:master Sep 15, 2016
@wborn wborn deleted the 4565-add-support-for-scan-sense-stealth-and-switch branch September 15, 2016 21:28
cdjackson added a commit to cdjackson/openhab1-addons that referenced this pull request Oct 9, 2016
* master: (30 commits)
  [satel] Fixed refresh after control command (openhab#4674)
  [IPX800] Add binding to OH2 distro (openhab#4684)
  Database update (openhab#4692)
  ZWave database update (openhab#4679)
  [xbmc] Minor formatting (openhab#4683)
  some changes to XBMC binding (openhab#4622)
  [telegram] sendTelegramPhoto caption should be UTF-8 (openhab#4650)
  New api url for forecastio provider (openhab#4677)
  Review 1: Patch for: Error on startup with SQLite openhab#4652 (openhab#4670)
  [Plugwise] Fix Circles not always calibrated (openhab#4669)
  Database update (openhab#4664)
  [garadget] Remove misleading text on exception logs (openhab#4663)
  Fixes openhab#4635 (openhab#4649)
  [Plugwise] NullPointerException may occur when concurrent threads get PlugwiseDevice from Stick (openhab#4648)
  insteonplm binding: added mini remote 2342-222 (openhab#4641)
  [modbus] Connection timeout parameter for TCP slaves. (openhab#4627)
  [Plugwise] Add openHAB 2 feature addon (openhab#4644)
  fixes build problems
  [Plugwise] Add support for Scan, Sense, Stealth and Switch openhab#4565 (openhab#4586)
  [satel] Added rule action to set user code (openhab#4634)
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants