ddxtanx / GoveeAPI

A python/gatttool API to control Govee lights.
110 stars 17 forks source link

Help #8

Closed ashbytaylors closed 1 year ago

ashbytaylors commented 1 year ago

Hi,

Can somebody provide an example of the format for name_addr_dict on tool.py please to specific my devices? It's not clear to me from the notes in the files.

Thanks

ddxtanx commented 1 year ago

The entries should have the key be the name of the device/scene that you wish to control, and the value should be a list of Bluetooth Addresses corresponding to the device/devices in the scene!

ashbytaylors commented 1 year ago

Sorry, I must sound daft, but can you provide an example entry for me please.

I have the following devices defined in constants.py:

devices = { "LoungeTV": "A4:C1:38:92:F4:0D", "Headboard": "D4:AD:FC:0B:04:FB", "Wardrobe": "7C:A6:B0:5C:D5:8B” }

How do I define this within tool.py, what is the exact syntax please?

Thanks, Neil

On 2 Dec 2022, at 15:29, Garrett Credi @.***> wrote:

The entries should have the key be the name of the device/scene that you wish to control, and the value should be a list of Bluetooth Addresses corresponding to the device/devices in the scene!

— Reply to this email directly, view it on GitHub https://github.com/ddxtanx/GoveeAPI/issues/8#issuecomment-1335422747, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4QQBJBXKJSWVXTCMT2Y6QDWLIIVJANCNFSM6AAAAAASQZWK4E. You are receiving this because you authored the thread.

ddxtanx commented 1 year ago

That looks good to me! I'd recommend just putting all of the addresses into a list. For example, back when I used this I had two LED strips, one that I had on my window, one I had on my bed, and I wanted to be able to control them both with a single command occasionally. So (iirc) my setup looked like

devices = { "window": ["{WINDOW MAC ADDRESS}"], "bed": ["{BED MAC ADDRESS}"], "bedroom": [ "{WINDOW MAC ADDRESS}", "{BED MAC ADDRESS}" ] }

And this definition was the same in tool and constants.py! (again, iirc. the original Pi I had my setup on went kaput, so I no longer have the exact configuration I used unfortunately...)