Closed alliefitter closed 4 years ago
@supersaiyanmode After playing around with the CLI I've been building, I've run into some issues using this feature. Namely, having this is as an instance method of a control requires that the client connect which is pretty hard to do when the TVs not on (which is also very obvious hindsight, lol.). After our discussion on #24 about the "agents," it seems pretty clear that you want this package to be an API interface/SDK and that you don't want to shove functionality into it. Correct me if I'm wrong, but if I'm not, you can go ahead an close this PR. I'm just going to add power on functionality to the CLI.
There were several reasons why I was always a hesitant about adding WOL into this library.
pywebostv.utils.power_on(host_name)
). This would then be the only API in the utils module, and unless there are others, adding WOL means adding a new dependency to the project.
power_on
is pretty useless when there's an active connection object ie TV is awake. We need a mechanism to save the IP address or MAC address for later use -- something that is out of scope for this library.But pros:
This makes it difficult for me to decide ...
Borrowed wake on lan functionality from LGWebOSRemote. klattimer was running
arp
withPopen
in order to get the TV's MAC address. I just added a dependency which is pure Python.