led-pixel-mapper implementation
Closed this issue · 5 comments
Hi there,
Really nice work, thanks for sharing.
I think to allow mapper working, in config.py
, the line in should be uncommented
vol.Optional('led-pixel-mapper', default='') : str,
and the trick is in display.py
were the option name is pixel_mapper_config
as the example here
# options.led_pixel_mapper = config['led-pixel-mapper']
options.pixel_mapper_config = config['led-pixel-mapper']
Thanks! I figured that'd be added to the Python API eventually so I'm glad to hear it has been added now. I will update.
This still does lead to a class of errors on older installs of the RBGmatix library.
Jan 15 08:06:48 tau-over-2 python[1234]: Traceback (most recent call last):
Jan 15 08:06:48 tau-over-2 python[1234]: File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
Jan 15 08:06:48 tau-over-2 python[1234]: "__main__", fname, loader, pkg_name)
Jan 15 08:06:48 tau-over-2 python[1234]: File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
Jan 15 08:06:48 tau-over-2 python[1234]: exec code in run_globals
Jan 15 08:06:48 tau-over-2 python[1234]: File "/home/pi/infopanel/infopanel/__main__.py", line 5, in <module>
Jan 15 08:06:48 tau-over-2 python[1234]: driver.run()
Jan 15 08:06:48 tau-over-2 python[1234]: File "/home/pi/infopanel/infopanel/driver.py", line 250, in run
Jan 15 08:06:48 tau-over-2 python[1234]: disp = display.display_factory(conf)
Jan 15 08:06:48 tau-over-2 python[1234]: File "/home/pi/infopanel/infopanel/display.py", line 154, in display_factory
Jan 15 08:06:48 tau-over-2 python[1234]: options = rgbmatrix_options_factory(config["RGBMatrix"])
Jan 15 08:06:48 tau-over-2 python[1234]: File "/home/pi/infopanel/infopanel/display.py", line 145, in rgbmatrix_options_factory
Jan 15 08:06:48 tau-over-2 python[1234]: options.led_pixel_mapper = config['led-pixel-mapper']
Jan 15 08:06:48 tau-over-2 python[1234]: AttributeError: 'rgbmatrix.core.RGBMatrixOptions' object has no attribute 'led_pixel_mapper'
Correct,
I tested in the meanwhile but not updated there, here is the fix for display.py
, needed to check with an ìf
if config["led-pixel-mapper"]:
options.pixel_mapper_config = config['led-pixel-mapper']
Just to mention that the current commit does not work, in display.py
line
options.led_pixel_mapper = config['led-pixel-mapper']
should be
options.pixel_mapper_config = config['led-pixel-mapper']
Thanks for the tip. Sorry about that. Didn't test properly. Just pushed another commit with your suggested change. 7f04aa0