OpenWonderLabs / python-host

The python code running on Raspberry Pi or other Linux based boards to control SwitchBot.
Apache License 2.0
379 stars 84 forks source link

The documentation for the set RGB on the color bulb is incorrect #34

Open AdyRock opened 2 years ago

AdyRock commented 2 years ago

Analysis

The documentation for the command to change the RGB value is incorrect. The column shows BYTE 3 is the Lvl but it is actually the Red colour. That in turn offsets the Green and Blue.

Expected Behavior

From the document I expect that sending [0x47, 0x01, 0x16, 0x32, 0xFF, 0x00, 0x00] would set the light to red and 50% brightness. It actually sets it to a red / green colour.

Sending [0x47, 0x01, 0x16, 0xFF, 0x00, 0x00] does actually set red.

Steps To Reproduce

Send [0x47, 0x01, 0x16, 0x32, 0xFF, 0x00, 0x00] the colour is red / green

Send [0x47, 0x01, 0x16, 0xFF, 0x00, 0x00] the colour is red.

Logs

No logs are required.

Configuration

No config

Environment

Additional Context

image

devWaves commented 2 years ago

@AdyRock

from quick testing:

If you want Brightness and RGB you would do... (using 0x12) [0x57, 0x0F, 0x47, 0x01, 0x12, 0x32, 0xFF, 0x00, 0x00]

if you want just RGB (no brightness) you would do... (using 0x16) [0x57, 0x0F, 0x47, 0x01, 0x16, 0xFF, 0x00, 0x00]

So yes the documentation is a little incorrect. good luck. I just started looking at implementing the bulb for my ESP32 code