Clara Hobbs 93d234e057 Added a simple PD Buddy Sink configuration library | 7 лет назад | |
---|---|---|
pdbuddy | 7 лет назад | |
.gitignore | 7 лет назад | |
LICENSE | 7 лет назад | |
README.md | 7 лет назад |
Python library for working with the PD Buddy Sink Serial Console Configuration Interface
>>> import pdbuddy
>>> pdbs = pdbuddy.Sink(list(pdbuddy.Sink.get_devices())[0])
>>> pdbs.get_cfg()
SinkConfig(status=SinkStatus.VALID, flags=SinkFlags.NONE, v=5000, i=3000)
>>> cfg = pdbs.get_cfg()
>>> cfg.v = 20000
>>> cfg.i = 2250
>>> cfg.flags |= pdbuddy.SinkFlags.GIVEBACK
>>> cfg
SinkConfig(status=SinkStatus.VALID, flags=SinkFlags.GIVEBACK, v=20000, i=2250)
>>> pdbs.set_tmpcfg(cfg)
>>> pdbs.write()
>>> pdbs.get_cfg()
SinkConfig(status=SinkStatus.VALID, flags=SinkFlags.GIVEBACK, v=20000, i=2250)