Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saturated Palette in InkyMockImpression not reachable #196

Open
PALcod3 opened this issue Jul 6, 2024 · 0 comments
Open

Saturated Palette in InkyMockImpression not reachable #196

PALcod3 opened this issue Jul 6, 2024 · 0 comments

Comments

@PALcod3
Copy link

PALcod3 commented Jul 6, 2024

File "/home/user/PycharmProjects/inky_weatherstation/.venv/lib/python3.12/site-packages/inky/mock.py", line 262, in set_image
  palette = inky_uc8159.Inky._palette_blend(self, saturation)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/PycharmProjects/inky_weatherstation/.venv/lib/python3.12/site-packages/inky/inky_uc8159.py", line 196, in _palette_blend
  rs, gs, bs = [c * saturation for c in self.SATURATED_PALETTE[i]]
                                        ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'InkyMockImpression' object has no attribute 'SATURATED_PALETTE'

When I try to mock the 7 color e-ink display it does not work because ot the missing SATURATED_PALETTE.
As a quick workaround I add the following from inky:uc8159.py into the InkyMockImpression class from mock.py:

SATURATED_PALETTE = [
        [57, 48, 57],
        [255, 255, 255],
        [58, 91, 70],
        [61, 59, 94],
        [156, 72, 75],
        [208, 190, 71],
        [177, 106, 73],
        [255, 255, 255]]

There must be a better way because inky_uc8159.py already contains the SATURATED_PALETTE two(!) times.

I got inky 1.5.0 installed on my IDE.

@PALcod3 PALcod3 changed the title Satrurated Palette in InkyMockImpression not reachable Saturated Palette in InkyMockImpression not reachable Jul 6, 2024
BreadMakesYouFull pushed a commit to BreadMakesYouFull/inky that referenced this issue Jul 25, 2024
BreadMakesYouFull pushed a commit to BreadMakesYouFull/inky that referenced this issue Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant