adamkempenich / magichome-python

MagicHome Wifi protocol for python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Initiation not working

reg-is opened this issue · comments

In the readme file, it is writen to use the MagicHomeAPi() method, which isn't defined. Shouldn't it be the __init__() method instead?

For __init__(self, device_ip, device_type, keep_alive=True), what am I suposed to enter for self and keep_alive=True?

UPDATE: Sorry, I never worked with Python before. I found the solution for my problem now

Sorry to not get back to this! If anyone else is unfamiliar with Python and happens upon this, self carries information about each device into each of the functions.
_keep/alive=true fixes a bug in the MagicHome devices, where a device will 'sleep' if it doesn't receive any communication after an extended amount of time. If you don't want this functionality, you can override it by setting your third function parameter to false.

TL;DR, no values are needed for self and _keep/alive