Closed richardwillars closed 8 years ago
@@ master #34 diff @@
==========================================
Files 2 2
Lines 269 269
Methods 57 57
Messages 0 0
Branches 38 38
==========================================
Hits 242 242
Misses 27 27
Partials 0 0
Powered by Codecov. Last update d26a20a...390eb34
There are two ways of detecting when a device has left the network:
The discover
method is meant to find previously unknown devices. Your change would however have the effect of discovering already known devices possibly over and over again which is not intended (thus the comment in the original code). As your change reverts this design decision that was well-considered I unfortunately have to reject it. I would however be happy to accept a pull-request that introduces a list
method that works in the way you described above if you feel there is a need for such a feature.
According to your feedback I changed the discover method (c6d9dc12ecb3199702a5bec37ae28b4de77f8946) to return devices that have previously been in an offline/error state and went back online. Before releasing 1.0 there will likely be a refactoring of the discovery and error handling that addresses connection related issues more consequently.
With the current library there is no way to know when WeMo devices have been removed from the local network. Currently the discover method only returned newly discovered devices.
This change ensures that all devices returned represent the current state of the WeMo devices on the network. Not only is this more accurate but it allows the consumer to understand when devices have been removed from the network.