Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Serializable entities #165

Open
CD-UNCC opened this issue Mar 7, 2020 · 4 comments
Open

Feature Request: Serializable entities #165

CD-UNCC opened this issue Mar 7, 2020 · 4 comments

Comments

@CD-UNCC
Copy link

CD-UNCC commented Mar 7, 2020

Have we thought about making classes serializable? One cannot json.dumps bridge.lights

@CD-UNCC CD-UNCC changed the title Feature Request Feature Request: Serializable entities Mar 7, 2020
@np3xpu
Copy link

np3xpu commented May 12, 2020

Out of curiosity, what's you use case for this?

@PeanutButterPhil
Copy link

Out of curiosity, what's you use case for this?

Great question, I was thinking the same. You can already identify by name, and index number once the system is established. I'm new here, but I want to keep adding to this library or fork, but I'm still discovering how to do it all.

@CD-UNCC
Copy link
Author

CD-UNCC commented Oct 27, 2020

Just trying to send bridge.lights back to a front end application as a json object. At least I think... sorry its been so long

@PeanutButterPhil
Copy link

Ah okay. Well, one thing I wrote for myself to handle lights was to make a For Loop and iterate through them. You could do that and add the key "name", "ID or Light Index" to a dictionary to pass to your front end as JSON.

I think my method used "hue_system"

for light, index in hue_system.get_lights():
# add items to your dict

Not sure if you've tried that already or if it's more difficult than that, but this among other simple things is something I want to contribute because it's not very easy to just get all color lights or get all white lights, sensors, and in a format that can be used such as in your case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants