Skip to content

Brightness to max combined with view type "off" = Full color view #17

@atchoo78

Description

@atchoo78

From what I can understand, the view type "off" (0x02) is the same as "Full color (spectrum) light" in the app, except the brightness is set to 0 in the header somehow.

From the README in https://github.com/derHeinz/divoom-adapter:

Following static byte array can be sent to show bright, dark and to deactivate display: 01 04 00 32 3f 75 00 02, 01 04 00 32 d2 08 03 04 02, 01 04 00 32 00 36 00 02

I added the following code (just out of curiousity), and it actually worked:

@cli.command(short_help='display full color light')
@click.option('--color', nargs=1)
@click.pass_context
def fullcolor(ctx, color):
    if (color):
        c = color_convert(Color(color).get_rgb())
        ctx.obj['dev'].send(set_full_color(c[0], c[1], c[2], 0xff))
    else:
        ctx.obj['dev'].send(set_full_color(0xff, 0xff, 0xff, 0xff))

def set_full_color(r, g, b, x):
    head = [0x09, 0x00, 0x45, 0x02, 0xFF]
    s = sum(head) + sum([r, g, b, x])
    ck1, ck2 = checksum(s)

    # create message mask 0x01,0x02,0x03
    msg = [0x01] + mask(head) + mask([r, g, b, x]) + mask([ck1, ck2]) + [0x02]

    return msg

Well, it ALMOST worked - because there's some odd offset somewhere in the rgb/hex conversion that I don't quite understand, so that's for someone else to find out, I guess.
If you pass the raw hex data to set full brightness (according to derHeinz) while in this view:

python timebox.py raw "01040032d208030402" 
  • you'll see that the "--color" argument works, although there's something weird going on with my message mask.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions