Skip to content

Sphero bolt set_matrix_pixel error on bad pixel value #44

@Alex-x90

Description

@Alex-x90

I accidentally tried to use set_matrix_pixel on a negative pixel value, which crashes the program in the following way:

"spherov2\controls\v2.py", line 157, in new_packet
    packet = Packet(flags, did, cid, self.__seq, tid, sid, bytearray(data or []))
                                                           ^^^^^^^^^^^^^^^^^^^^^
ValueError: byte must be in range(0, 256)

While it makes sense that calling set_matrix_pixel on a negative pixel location wouldn't work, it should ideally be handled gracefully and at the very least return a specific error rather than crashing the program.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions