flickerstrip-py/flickerstrip_py/pattern.py

18 lines
486 B
Python

class PatternMeta:
def __init__(self, id, name, frames, pixels, flags, fps):
self.id = id
self.name = name
self.frames = frames
self.pixels = pixels
self.flags = flags
self.fps = fps
def fromJSON(json):
return PatternMeta(
json["id"], json["name"], json["frames"],
json["pixels"], json["flags"], json["fps"]
)
def fromJSONArray(array):
return map(PatternMeta.fromJSON, array)