Skip to content

Commit 1950410

Browse files
committed
Merge remote-tracking branch 'origin/main' into hicwic/feature/plot-graph
2 parents 753c303 + c44c646 commit 1950410

File tree

20 files changed

+600
-8
lines changed

20 files changed

+600
-8
lines changed

library/lcd/lcd_comm_rev_c.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class Command(Enum):
7777
# STATIC IMAGE
7878
START_DISPLAY_BITMAP = bytearray((0x2c,))
7979
PRE_UPDATE_BITMAP = bytearray((0x86, 0xef, 0x69, 0x00, 0x00, 0x00, 0x01))
80-
UPDATE_BITMAP = bytearray((0xcc, 0xef, 0x69, 0x00, 0x00))
80+
UPDATE_BITMAP = bytearray((0xcc, 0xef, 0x69, 0x00))
8181

8282
RESTARTSCREEN = bytearray((0x84, 0xef, 0x69, 0x00, 0x00, 0x00, 0x01))
8383
DISPLAY_BITMAP = bytearray((0xc8, 0xef, 0x69, 0x00, 0x17, 0x70))
@@ -352,7 +352,7 @@ def _generate_update_image(self, image, x, y, count, cmd: Command = None,
352352
img_raw_data.append(f'{current_pixel[2]:02x}{current_pixel[1]:02x}{current_pixel[0]:02x}')
353353

354354
image_msg = ''.join(img_raw_data)
355-
image_size = f'{int((len(image_msg) / 2) + 2):04x}' # The +2 is for the "ef69" that will be added later.
355+
image_size = f'{int((len(image_msg) / 2) + 2):06x}' # The +2 is for the "ef69" that will be added later.
356356

357357
# logger.debug("Render Count: {}".format(count))
358358
payload = bytearray()

library/sensors/sensors_python.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,15 @@ def virtual_percent() -> float:
355355

356356
@staticmethod
357357
def virtual_used() -> int: # In bytes
358-
return psutil.virtual_memory().used
358+
# Do not use psutil.virtual_memory().used: from https://psutil.readthedocs.io/en/latest/#memory
359+
# "It is calculated differently depending on the platform and designed for informational purposes only"
360+
return psutil.virtual_memory().total - psutil.virtual_memory().available
359361

360362
@staticmethod
361363
def virtual_free() -> int: # In bytes
362-
return psutil.virtual_memory().free
364+
# Do not use psutil.virtual_memory().free: from https://psutil.readthedocs.io/en/latest/#memory
365+
# "note that this doesn’t reflect the actual memory available (use available instead)."
366+
return psutil.virtual_memory().available
363367

364368

365369
class Disk(sensors.Disk):

library/stats.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,19 +518,19 @@ def stats():
518518

519519
display_themed_value(
520520
theme_data=memory_stats_theme_data['VIRTUAL']['USED'],
521-
value=int(sensors.Memory.virtual_used() / 1000000),
521+
value=int(sensors.Memory.virtual_used() / 1024**2),
522522
min_size=5,
523523
unit=" M"
524524
)
525525
display_themed_value(
526526
theme_data=memory_stats_theme_data['VIRTUAL']['FREE'],
527-
value=int(sensors.Memory.virtual_free() / 1000000),
527+
value=int(sensors.Memory.virtual_free() / 1024**2),
528528
min_size=5,
529529
unit=" M"
530530
)
531531
display_themed_value(
532532
theme_data=memory_stats_theme_data['VIRTUAL']['TOTAL'],
533-
value=int((sensors.Memory.virtual_free() + sensors.Memory.virtual_used()) / 1000000),
533+
value=int((sensors.Memory.virtual_free() + sensors.Memory.virtual_used()) / 1024**2),
534534
min_size=5,
535535
unit=" M"
536536
)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ psutil~=5.9.8 # CPU / disk / network metrics
66
pystray~=0.19.5 # Tray icon (all OS)
77
babel~=2.14.0 # Date/time formatting
88
ruamel.yaml~=0.18.5 # For configuration editor
9-
sv-ttk~=2.5.5 # Tk Sun Valley theme for configuration editor
9+
sv-ttk~=2.6.0 # Tk Sun Valley theme for configuration editor
1010

1111
# Efficient image serialization
1212
numpy~=1.24.4; python_version < "3.9" # For Python 3.8 max.
300 Bytes
Loading

res/themes/5inchTheme2/preview.png

332 Bytes
Loading
305 Bytes
Loading

res/themes/CyanTheme/preview.png

5 Bytes
Loading
472 Bytes
Loading

res/themes/Cyberpunk/preview.png

475 Bytes
Loading

0 commit comments

Comments
 (0)