-
-
Notifications
You must be signed in to change notification settings - Fork 568
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revise device (broadcast-using) discovery process
This is the initial commit to rework the handshake/discovery process, separating them to separate entities. The discovery part from Device class is moved into MiIODiscovery class usable for broadcast discovery of available devices. Also, instead of printing out the details from discovered devices, a list of Devices is being returned. The discover() method of the class is extended to allow discovery on all network interfaces (instead of using 255.255.255.255), making it easier to perform the initial configuration of non-provisioned devices and/or work with devices in other subnets. Although the change cause some duplicate code (mainly the handshake payload), this will make the responsibilities of corresponding classes clearer and code more usable for 3rd party developers. There will be cleanups and (likely also) renamings of some of the parts, but I wanted to make this available for others to comment. TODO: * Upcasting the Device to a corresponding implementation class (miIO.info model information could be useful, too..) * Decide how to handle the returning of discovered devices. Use a separate DiscoveredDevice class which can be used to initialize the real device, or use the existing Device and do the casting trick? Related to #152 (and maybe #422).
- Loading branch information
Showing
6 changed files
with
173 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters