Skip to content

Commit a7b70fe

Browse files
authored
Merge branch 'main' into feature/add-cyberpunk-net-theme
2 parents e024317 + 1d23519 commit a7b70fe

21 files changed

+224
-15
lines changed

.github/workflows/simple-program-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
python-version: ["3.7", "3.8", "3.9", "3.10"]
19+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
2020

2121
steps:
2222
- uses: actions/checkout@v3

.github/workflows/simple-program-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: ["3.7", "3.8", "3.9", "3.10"]
18+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
1919

2020
steps:
2121
- uses: actions/checkout@v3

.github/workflows/simple-program-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: ["3.7", "3.8", "3.9", "3.10"]
18+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
1919

2020
steps:
2121
- uses: actions/checkout@v3

.github/workflows/system-monitor-linux.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: ["3.7", "3.8", "3.9", "3.10"]
19-
theme: [ "3.5inchTheme2", "Cyberpunk", "Cyberpunk-net", "Landscape6Grid", "Terminal", "bash-dark-green", "bash-dark-green-gpu", "LandscapeMagicBlue" ]
18+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
19+
theme: [ "3.5inchTheme2", "Cyberpunk", "Cyberpunk-net", "Landscape6Grid", "Terminal", "bash-dark-green", "bash-dark-green-gpu",
20+
"LandscapeMagicBlue", "BigClock" ]
2021

2122
steps:
2223
- uses: actions/checkout@v3

.github/workflows/system-monitor-macos.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: ["3.7", "3.8", "3.9", "3.10"]
19-
theme: [ "3.5inchTheme2", "Cyberpunk", "Cyberpunk-net", "Landscape6Grid", "Terminal", "bash-dark-green", "bash-dark-green-gpu", "LandscapeMagicBlue" ]
18+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
19+
theme: [ "3.5inchTheme2", "Cyberpunk", "Cyberpunk-net", "Landscape6Grid", "Terminal", "bash-dark-green", "bash-dark-green-gpu",
20+
"LandscapeMagicBlue", "BigClock" ]
2021

2122
steps:
2223
- uses: actions/checkout@v3

.github/workflows/system-monitor-windows.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: ["3.7", "3.8", "3.9", "3.10"]
19-
theme: [ "3.5inchTheme2", "Cyberpunk", "Cyberpunk-net", "Landscape6Grid", "Terminal", "bash-dark-green", "bash-dark-green-gpu", "LandscapeMagicBlue" ]
18+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
19+
theme: [ "3.5inchTheme2", "Cyberpunk", "Cyberpunk-net", "Landscape6Grid", "Terminal", "bash-dark-green", "bash-dark-green-gpu",
20+
"LandscapeMagicBlue", "BigClock" ]
2021

2122
steps:
2223
- uses: actions/checkout@v3

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Supported operating systems : macOS, Windows, Linux (incl. Raspberry Pi), basica
1919
Supported smart screens models:
2020
| **Turing Smart Screen** | **XuanFang** |
2121
|--------|----------|
22-
| <img src="https://ae01.alicdn.com/kf/S4cd5d420d8034c7e8ff1cb40fdad0bccR.jpg" height="300" /> | <img src="https://ae01.alicdn.com/kf/S28f803263a05455e86c58fb8f2572815K.jpg" height="300" /> |
22+
| <img src="res/docs/turing.webp" height="300" /> | <img src="res/docs/xuanfang.webp" height="300" /> |
2323
| also improperly called "revision A" by the resellers | revision B & flagship (with backplate & RGB LEDs) |
2424

2525
### [> What is my smart screen model?](https://github.com/mathoudebine/turing-smart-screen-python/wiki/Hardware-revisions)
@@ -54,8 +54,8 @@ Some themes are already included for a quick start!
5454
* Auto detect comm port. No longer need to hard set it, or if it changes on you then the config is wrong.
5555
* Tray icon with Exit option, useful when the program is running in background
5656

57-
Screenshots from the latest version using included themes:
58-
<img src="res/docs/Theme3.5Inch.jpg" height="400" /> <img src="res/docs/ThemeTerminal.jpg" height="400" /> <img src="res/docs/ThemeCyberpunk.png" height="400" /> <img src="res/docs/ThemeBashDarkGreen.png" height="400" /> <img src="res/docs/ThemeLandscape6Grid.jpg" width="400" /> <img src="res/docs/ThemeLandscapeMagicBlue.png" width="400" />
57+
Screenshots from the latest version using included themes (click on the thumbnails to see a bigger preview):
58+
<img src="res/docs/Theme3.5Inch.jpg" height="300" /> <img src="res/docs/ThemeTerminal.jpg" height="300" /> <img src="res/docs/ThemeCyberpunk.png" height="300" /> <img src="res/docs/ThemeBashDarkGreenGpu.png" height="300" /> <img src="res/docs/ThemeLandscape6Grid.jpg" width="300" /> <img src="res/docs/ThemeLandscapeMagicBlue.png" width="300" />
5959

6060
### [> Themes creation/edition](https://github.com/mathoudebine/turing-smart-screen-python/wiki/System-monitor-:-themes)
6161
### [> Themes shared by the community](https://github.com/mathoudebine/turing-smart-screen-python/discussions/categories/themes)

config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ config:
1717
# - Cyberpunk-net
1818
# - bash-dark-green
1919
# - bash-dark-green-gpu
20+
# - BigClock
2021
THEME: 3.5inchTheme2
2122

2223
# Hardware sensors reading

library/config.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def load_yaml(configfile):
3535

3636
PATH = sys.path[0]
3737
CONFIG_DATA = load_yaml("config.yaml")
38+
THEME_DEFAULT = load_yaml("res/themes/default.yaml")
3839

3940
try:
4041
theme_path = "res/themes/" + CONFIG_DATA['config']['THEME'] + "/"
@@ -48,5 +49,16 @@ def load_yaml(configfile):
4849
except:
4950
os._exit(0)
5051

52+
def copy_default(default, theme):
53+
"recursively supply default values into a dict of dicts of dicts ...."
54+
for k,v in default.items():
55+
if k not in theme:
56+
theme[k] = v
57+
if type(v) == type({}):
58+
copy_default(default[k], theme[k])
59+
60+
61+
copy_default(THEME_DEFAULT, THEME_DATA)
62+
5163
# Queue containing the serial requests to send to the screen
5264
update_queue = queue.Queue()

library/display.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def initialize_display(self):
9797
self.lcd.SetOrientation(_get_theme_orientation())
9898

9999
def display_static_images(self):
100-
if THEME_DATA['static_images']:
100+
if THEME_DATA.get('static_images', False):
101101
for image in THEME_DATA['static_images']:
102102
logger.debug(f"Drawing Image: {image}")
103103
self.lcd.DisplayBitmap(
@@ -109,7 +109,7 @@ def display_static_images(self):
109109
)
110110

111111
def display_static_text(self):
112-
if THEME_DATA['static_text']:
112+
if THEME_DATA.get('static_text', False):
113113
for text in THEME_DATA['static_text']:
114114
logger.debug(f"Drawing Text: {text}")
115115
self.lcd.DisplayText(

0 commit comments

Comments
 (0)