Skip to content

Commit eb80b94

Browse files
committed
fix: bump epaper-dithering version to support GRAYSCALE_8 and GRAYSCALE_16
1 parent 41ca904 commit eb80b94

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dependencies = [
3434
"pillow>=10.0.0",
3535
"numpy>=1.24.0,!=2.4.0",
3636
"bleak-retry-connector>=3.5.0",
37-
"epaper-dithering==0.6.3",
37+
"epaper-dithering==0.6.4",
3838
"cryptography>=41.0.0",
3939
"rich>=13.0.0",
4040
]

src/opendisplay/device.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
encode_image,
2626
fit_image,
2727
)
28-
from .exceptions import AuthenticationRequiredError, AuthenticationSessionExistsError, ProtocolError
28+
from .exceptions import AuthenticationRequiredError, AuthenticationSessionExistsError, ImageEncodingError, ProtocolError
2929
from .models.capabilities import DeviceCapabilities
3030
from .models.config import GlobalConfig
3131
from .models.enums import BoardManufacturer, FitMode, RefreshMode, Rotation
@@ -1118,9 +1118,16 @@ def _extract_capabilities_from_config(self) -> DeviceCapabilities:
11181118
display = self._config.displays[0] # Primary display
11191119

11201120
r = display.rotation_enum
1121+
try:
1122+
color_scheme = ColorScheme.from_value(display.color_scheme)
1123+
except ValueError as exc:
1124+
raise ImageEncodingError(
1125+
f"Device uses unsupported color scheme value {display.color_scheme}. "
1126+
"Reconfigure the device to a supported color scheme (0–5)."
1127+
) from exc
11211128
return DeviceCapabilities(
11221129
width=display.pixel_width,
11231130
height=display.pixel_height,
1124-
color_scheme=ColorScheme.from_value(display.color_scheme),
1131+
color_scheme=color_scheme,
11251132
rotation=r.value if isinstance(r, Rotation) else 0,
11261133
)

0 commit comments

Comments
 (0)