lucien2k / sonoff-python

Make use of your sonoff smart switches without flashing them via the cloud APIs
MIT License
51 stars 32 forks source link

All HTTP status codes are undefined #5

Closed Galgofrit closed 4 years ago

Galgofrit commented 5 years ago

I can't run the code due to missing definitions on HTTP_MOVED_PERMANENTLY/HTTP_NOT_FOUND/HTTP_BAD_REQUEST/HTTP_UNAUTHORIZED.... I don't see them defined in the code, and I don't see any "from (%s) import *", so I really don't understand where those are supposed to be defined... I can obviously define them myself (I assume they're just the status code numbers?) What am I missing/doing wrong?

peterbuga commented 5 years ago

that's because the code was mostly copy-paste from my homeassistant integration without proper conversion 😅

i came across this because i was planning to release the standalone package (cough) with far more devices support (cough) but i saw the name was already taken on pypi :( back to drawing board i guess ...

Galgofrit commented 5 years ago

Working perfectly after I defined the status code numbers... If you want I can PR with a module with the status codes

lucien2k commented 4 years ago

Someone very kindly sorted this out, sorry it took so long!