robweber / omni-epd

An EPD (electronic paper display) class abstraction to simplify communications across multiple display types.
GNU General Public License v3.0
83 stars 19 forks source link

waveshare_epd.epd1in54_V2 wrong init() #101

Closed robweber closed 1 month ago

robweber commented 1 month ago
          I tried omni-epd with a waveshare_epd.epd1in54_V2.

omni-epd-test fails with

Loaded waveshare_epd.epd1in54_V2 with width 200 and height 200
Drawing rectangle of width 150.0 and height 150.0
Drawing rectangle of width 75.0 and height 75.0
Drawing rectangle of width 18.75 and height 18.75
Traceback (most recent call last):
  File "/media/pi/INTENSO/RBP-IN/home/welf/bin/epd/venv_epd/bin/omni-epd-test", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/media/pi/INTENSO/RBP-IN/home/welf/bin/epd/venv_epd/lib/python3.11/site-packages/omni_epd/test_utility.py", line 138, in main
    test.draw()
  File "/media/pi/INTENSO/RBP-IN/home/welf/bin/epd/venv_epd/lib/python3.11/site-packages/omni_epd/test_utility.py", line 84, in draw
    self.__draw_on_display(im)
  File "/media/pi/INTENSO/RBP-IN/home/welf/bin/epd/venv_epd/lib/python3.11/site-packages/omni_epd/test_utility.py", line 64, in __draw_on_display
    self.epd.prepare()
  File "/media/pi/INTENSO/RBP-IN/home/welf/bin/epd/venv_epd/lib/python3.11/site-packages/omni_epd/displays/waveshare_display.py", line 129, in prepare
    self._device.init()
TypeError: EPD.init() missing 1 required positional argument: 'isPartial'

Looks like this parameter is requested by the waveshare drivers:

venv_epd/lib64/python3.11/site-packages/waveshare_epd/epd1in54_V2.py:    def init(self, isPartial):
venv_epd/lib64/python3.11/site-packages/waveshare_epd/epd1in54_V2.py:        if(isPartial):

Originally posted by @W11T in https://github.com/robweber/omni-epd/issues/68#issuecomment-2387117041

robweber commented 1 month ago

Confirmed at source that epd1in54_V2 needs the alt init parameter.

robweber commented 1 month ago

@W11T - please test if you have time