Skip to content

Commit

Permalink
Merge pull request #64 from txoof/I63_epdconfig
Browse files Browse the repository at this point in the history
remove epdconfig load by default
  • Loading branch information
txoof authored Mar 12, 2024
2 parents 1b7a53d + 1a6c78b commit f861e85
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 17 deletions.
133 changes: 120 additions & 13 deletions epdlib/Screen.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "9048fc82",
"metadata": {},
"outputs": [],
Expand All @@ -17,7 +17,21 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "687596b4-507e-494f-8a73-3d0154ace6bf",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import logging\n",
"import sys\n",
"import time\n",
"import subprocess"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "f19afec5",
"metadata": {},
"outputs": [],
Expand All @@ -34,12 +48,12 @@
"except ImportError as e:\n",
" import constants\n",
"\n",
"from waveshare_epd import epdconfig"
"# from waveshare_epd import epdconfig"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"id": "42b4c3f4",
"metadata": {
"code_folding": [
Expand Down Expand Up @@ -71,7 +85,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"id": "af13ea8b",
"metadata": {
"code_folding": [
Expand Down Expand Up @@ -153,7 +167,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"id": "007f7c73",
"metadata": {
"code_folding": [
Expand All @@ -169,7 +183,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"id": "d297edec",
"metadata": {
"code_folding": [
Expand Down Expand Up @@ -237,7 +251,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"id": "90044dce",
"metadata": {
"code_folding": [
Expand Down Expand Up @@ -511,6 +525,7 @@
" '''\n",
" \n",
" import waveshare_epd\n",
" # from waveshare_epd import epdconfig\n",
" import pkgutil\n",
" import inspect\n",
" from importlib import import_module\n",
Expand Down Expand Up @@ -779,15 +794,16 @@
" # self.epd.module_exit(cleanup=True)\n",
" logging.info('shutting down epd interface')\n",
" try:\n",
" epdconfig.module_exit(cleanup=True)\n",
" # epdconfig.module_exit(cleanup=True)\n",
" pass\n",
" except GPIODeviceError as e:\n",
" logging.warning(f'failed to sleep module: {e}')\n",
" raise ScreenError(e)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"id": "a2600501",
"metadata": {
"code_folding": []
Expand Down Expand Up @@ -887,7 +903,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"id": "1abb1892",
"metadata": {
"code_folding": []
Expand Down Expand Up @@ -1046,10 +1062,101 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 12,
"id": "085eafa4",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"loading Layout module\n",
"trying alternative module\n",
"|Screen |Supported |Mode |\n",
"|:-----------------|:--------------|:-------------|\n",
"|00. epd13in3k |True |\"1\" 1 bit |\n",
"|01. epd1in02 |True |\"1\" 1 bit |\n",
"|02. epd1in54 |True |\"1\" 1 bit |\n",
"|03. epd1in54_V2 |True |\"1\" 1 bit |\n",
"|04. epd1in54b |True |\"1\" 1 bit |\n",
"|05. epd1in54b_V2 |True |\"1\" 1 bit |\n",
"|06. epd1in54c |True |\"1\" 1 bit |\n",
"|07. epd1in64g |True |\"1\" 1 bit |\n",
"|08. epd2in13 |True |\"1\" 1 bit |\n",
"|09. epd2in13_V2 |True |\"1\" 1 bit |\n",
"|10. epd2in13_V3 |True |\"1\" 1 bit |\n",
"|11. epd2in13_V4 |True |\"1\" 1 bit |\n",
"|12. epd2in13b_V3 |True |\"1\" 1 bit |\n",
"|13. epd2in13b_V4 |True |\"1\" 1 bit |\n",
"|14. epd2in13bc |True |\"1\" 1 bit |\n",
"|15. epd2in13d |False |Unsupported |\n",
"|16. epd2in13g |True |\"1\" 1 bit |\n",
"|17. epd2in36g |True |\"1\" 1 bit |\n",
"|18. epd2in66 |True |\"1\" 1 bit |\n",
"|19. epd2in66b |True |\"1\" 1 bit |\n",
"|20. epd2in66g |True |\"1\" 1 bit |\n",
"|21. epd2in7 |True |\"1\" 1 bit |\n",
"|22. epd2in7_V2 |True |\"1\" 1 bit |\n",
"|23. epd2in7b |True |\"1\" 1 bit |\n",
"|24. epd2in7b_V2 |True |\"1\" 1 bit |\n",
"|25. epd2in9 |True |\"1\" 1 bit |\n",
"|26. epd2in9_V2 |True |\"1\" 1 bit |\n",
"|27. epd2in9b_V3 |True |\"1\" 1 bit |\n",
"|28. epd2in9b_V4 |True |\"1\" 1 bit |\n",
"|29. epd2in9bc |True |\"1\" 1 bit |\n",
"|30. epd2in9d |False |Unsupported |\n",
"|31. epd3in0g |True |\"1\" 1 bit |\n",
"|32. epd3in52 |True |\"1\" 1 bit |\n",
"|33. epd3in7 |False |Unsupported |\n",
"|34. epd4in01f |True |\"RGB\" 7 Color |\n",
"|35. epd4in2 |False |Unsupported |\n",
"|36. epd4in26 |True |\"1\" 1 bit |\n",
"|37. epd4in2_V2 |False |Unsupported |\n",
"|38. epd4in2b_V2 |True |\"1\" 1 bit |\n",
"|39. epd4in2bc |True |\"1\" 1 bit |\n",
"|40. epd4in37g |True |\"1\" 1 bit |\n",
"|41. epd5in65f |True |\"RGB\" 7 Color |\n",
"|42. epd5in83 |True |\"1\" 1 bit |\n",
"|43. epd5in83_V2 |True |\"1\" 1 bit |\n",
"|44. epd5in83b_V2 |True |\"1\" 1 bit |\n",
"|45. epd5in83bc |True |\"1\" 1 bit |\n",
"|46. epd7in3f |True |\"RGB\" 7 Color |\n",
"|47. epd7in3g |True |\"1\" 1 bit |\n",
"|48. epd7in5 |True |\"1\" 1 bit |\n",
"|49. epd7in5_HD |True |\"1\" 1 bit |\n",
"|50. epd7in5_V2 |True |\"1\" 1 bit |\n",
"|51. epd7in5_V2_old|True |\"1\" 1 bit |\n",
"|52. epd7in5b_HD |True |\"1\" 1 bit |\n",
"|53. epd7in5b_V2 |True |\"1\" 1 bit |\n",
"|54. epd7in5bc |True |\"1\" 1 bit |\n",
"|55. All HD IT8951 |True |\"L\" 8 bit |\n",
"\n",
"Use `list_complatible_modules(reasons=True)` for more information.\n"
]
},
{
"name": "stdin",
"output_type": "stream",
"text": [
"Enter the number of your choice: 42\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"using font: /home/pi/src/epdlib/epdlib/../fonts/Font.ttc\n",
"setup for rotation: 0\n",
"print some text on the display\n",
"sleeping for 2 seconds\n",
"refresh screen -- screen should flash and be refreshed\n",
"mirror output\n",
"clear screen\n",
"shutting down interface\n",
"name 'epdconfig' is not defined\n"
]
}
],
"source": [
"if __name__ == '__main__':\n",
" e= main()"
Expand Down
16 changes: 12 additions & 4 deletions epdlib/Screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.16.0
# jupytext_version: 1.16.1
# kernelspec:
# display_name: venv_epdlib-bed2b1faf1
# language: python
Expand All @@ -20,6 +20,13 @@
# %autoreload 2

# %reload_ext autoreload
# -

import os
import logging
import sys
import time
import subprocess

# +
import logging
Expand All @@ -34,8 +41,7 @@
except ImportError as e:
import constants

from waveshare_epd import epdconfig

# from waveshare_epd import epdconfig

# + code_folding=[0]
def strict_enforce(*types):
Expand Down Expand Up @@ -460,6 +466,7 @@ def _load_non_hd(self, epd):
'''

import waveshare_epd
# from waveshare_epd import epdconfig
import pkgutil
import inspect
from importlib import import_module
Expand Down Expand Up @@ -728,7 +735,8 @@ def module_exit(self):
# self.epd.module_exit(cleanup=True)
logging.info('shutting down epd interface')
try:
epdconfig.module_exit(cleanup=True)
# epdconfig.module_exit(cleanup=True)
pass
except GPIODeviceError as e:
logging.warning(f'failed to sleep module: {e}')
raise ScreenError(e)
Expand Down

0 comments on commit f861e85

Please sign in to comment.