Skip to content

Commit

Permalink
Fix regression bug caused by device consolidation PR (#232)
Browse files Browse the repository at this point in the history
Fixes: rm-hull/luma.examples#95

* Fix regress bug caused by device consolidation PR
* Fix flake8 violation 馃檮
* Add changelog entry
  • Loading branch information
rm-hull committed Dec 15, 2018
1 parent 2213f1b commit c6c8bda
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Expand Up @@ -4,6 +4,8 @@ ChangeLog
+------------+---------------------------------------------------------------------+------------+
| Version | Description | Date |
+============+=====================================================================+============+
| *upcoming* | * Fix bug where SSD1325/1327 didn't handle ``framebuffer`` properly | |
+------------+---------------------------------------------------------------------+------------+
| **3.0.0** | * **BREAKING** Fix SSD1351 init sequence didn't set RGB/BGR color | 2018/12/02 |
| | order properly. Users of this device should verify proper color | |
| | rendering and add ``bgr=True`` if blue/red color components | |
Expand Down
16 changes: 8 additions & 8 deletions luma/oled/device/__init__.py
Expand Up @@ -462,11 +462,11 @@ class ssd1325(greyscale_device):
display to properly configure it. Further control commands can then be
called to affect the brightness and other settings.
"""
def __init__(self, serial_interface=None, width=128, height=64, rotate=0, mode="RGB", **kwargs):
def __init__(self, serial_interface=None, width=128, height=64, rotate=0,
mode="RGB", framebuffer="full_frame", **kwargs):
super(ssd1325, self).__init__(luma.core.const.common, serial_interface,
width, height, rotate, mode,
framebuffer="full_frame", nibble_order=1,
**kwargs)
width, height, rotate, mode, framebuffer,
nibble_order=1, **kwargs)

def _supported_dimensions(self):
return [(128, 64)]
Expand Down Expand Up @@ -509,11 +509,11 @@ class ssd1327(greyscale_device):
.. versionadded:: 2.4.0
"""
def __init__(self, serial_interface=None, width=128, height=128, rotate=0, mode="RGB", **kwargs):
def __init__(self, serial_interface=None, width=128, height=128, rotate=0,
mode="RGB", framebuffer="full_frame", **kwargs):
super(ssd1327, self).__init__(luma.core.const.common, serial_interface,
width, height, rotate, mode,
framebuffer="full_frame", nibble_order=1,
**kwargs)
width, height, rotate, mode, framebuffer,
nibble_order=1, **kwargs)

def _supported_dimensions(self):
return [(128, 128)]
Expand Down
7 changes: 7 additions & 0 deletions tests/test_ssd1325.py
Expand Up @@ -91,3 +91,10 @@ def test_monochrome_display():

# Next 4096 bytes are data representing the drawn image
serial.data.assert_called_once_with(get_json_data('demo_ssd1325_monochrome'))


def test_framebuffer_override():
"""
Reproduce https://github.com/rm-hull/luma.examples/issues/95
"""
ssd1325(serial, mode="1", framebuffer="diff_to_previous")
7 changes: 7 additions & 0 deletions tests/test_ssd1327.py
Expand Up @@ -91,3 +91,10 @@ def test_monochrome_display():

# Next 4096 bytes are data representing the drawn image
serial.data.assert_called_once_with(get_json_data('demo_ssd1327_monochrome'))


def test_framebuffer_override():
"""
Reproduce https://github.com/rm-hull/luma.examples/issues/95
"""
ssd1327(serial, mode="1", framebuffer="diff_to_previous")

0 comments on commit c6c8bda

Please sign in to comment.