wendlers / ediplug-py

Simple Python class to access a "EDIMAX Smart Plug Switch SP-1101W"
MIT License
32 stars 19 forks source link

Not compatible with firmware 2.08? #7

Open baferon opened 7 years ago

baferon commented 7 years ago

Hi, I'm trying to control my Edimax SP 2101 W (Firmware 2.08 according to Edi life) and I get this error: Exception: Failed to communicate with SmartPlug The IP adress, the login and password are right as well... I used exactly the same code for my SP 1101 and it was working perfectly... Do you have any idea? Thanks for your answer

awscumba commented 7 years ago

Recent firmware versions appear to use HTTPDigestAuth instead of HTTPBasicAuth.

Just change Line 652 from: p = SmartPlug(options.host, (options.login, options.password)) to: p = SmartPlug(options.host, req.auth.HTTPDigestAuth(options.login, options.password))

I do not have enough downlevel devices to test if HTTPBasicAuth is still working after that. Would be nice to know, though.

awscumba commented 7 years ago

If you use the Smartplug class in any python scripts the above approach will not help you. You have to do similar changes in the functions '_post_xml' and '_post_xml_dom'.