sbidy / pywizlight

A python connector for WiZ devices
MIT License
463 stars 79 forks source link

Fixed errors in README.md example code. #70

Closed nollium closed 3 years ago

nollium commented 3 years ago

DiscoveredBulb has no field "ip" but has a field "ip_address".

The variable "bulb" corresponds to a bulb list in this script, so it has no field "bulbtype", it seems the variable that should be used there is "light"

nollium commented 3 years ago

I looked into the code a bit more and it actually seems more likely that the method find_wizlight() has been mistakenly used instead of the discover_lights() method, the first one returns a DisoveredBulb list , which only has attributes "ip" and "mac_address", the latter returns a wizlight list, which has an "ip_address" attribute, this is not coherent, these attributes represent the exact same thing, they should have the exact same name.

DisoveredBulb class isn't much useful to a regular user, and so is the find_wizlights method, they are internal stuff, I suggest replacing the usage of find_wizlights by discover_lights in the readme example.

sbidy commented 3 years ago

@all-contributors please add @Dirty-No docs

allcontributors[bot] commented 3 years ago

@sbidy

I've put up a pull request to add @Dirty-No! :tada: