You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my personal opinion, the public API should be much more simpler. Developers who jump on board should not have to deal with PilotBuilder and asyncio as this are internals and should not be part of implementations. Once you switch one of these, the upgrade paths are going to be a nightmare.
I have helpers like that in my code - it is too complex just to get the name of a light:
light.name
# Or just a collection that contains all the things
light.info()['name']
This is an suggestion of a potential future API - we can still have await but also handy _sync methods:
await light.turn_on()
# Set bulb brightness
await light.turn_on(brightness = 255)
# Provide sync calls aswell using run_until_complete internal
light.turn_on_sync(brightness = 255)
# Set bulb brightness (with async timeout)
timeout = 10
await light.turn_on(brightness = 255), timeout)
# Set bulb to warm white
await light.turn_on(warm_white = 255)
# Set RGB values
# red to 0 = 0%, green to 128 = 50%, blue to 255 = 100%
await light.turn_on(rgb = (0, 128, 255))
As you can see this looks easier and both dependencies are hidden. I don't want to offend someone, this is just honest feedback to make everyone's life easier. Thanks
The text was updated successfully, but these errors were encountered:
In my personal opinion, the public API should be much more simpler. Developers who jump on board should not have to deal with
PilotBuilder
andasyncio
as this are internals and should not be part of implementations. Once you switch one of these, the upgrade paths are going to be a nightmare.I have helpers like that in my code - it is too complex just to get the name of a light:
Why not just:
This is an suggestion of a potential future API - we can still have await but also handy
_sync
methods:As you can see this looks easier and both dependencies are hidden. I don't want to offend someone, this is just honest feedback to make everyone's life easier. Thanks
The text was updated successfully, but these errors were encountered: