sbidy / pywizlight

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

Store bulb data in external files #59

Closed eutampieri closed 3 years ago

eutampieri commented 3 years ago

This PR aims at splitting bulbs metadata for usage in other libraries.

eutampieri commented 3 years ago

The JSON file was generated this way:

from json import dumps
f = open("out.json",'w')
f.write(dumps([{k:(v.__dict__ if hasattr(v, '__dict__') else v) for (k,v) in i.__dict__.items()} for i in a.getBulbList()]))
f.close()

, so it should contain no errors

eutampieri commented 3 years ago

Please note that you have to git submodule init && git submodule update to fetch them from here before packaging the library, and the JSON file have to be added to the packaged version (I think it's done this way, but I'm no Python expert)

sbidy commented 3 years ago

I'll not merge this pull because of some upcoming features. This will made the "libaray" obsolete in the future. In addition I'll agree with @fabaff - to store this outside this repo. the maintainability is really difficult and creates (already) some errors end issues.

eutampieri commented 3 years ago

Fine, this would have made easier to implement libraries in other languages but it seems that you’re not considering it as a feature