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

feat: add enhanced sysinfo.py #163

Merged
merged 6 commits into from
Sep 25, 2023

Conversation

rlaace423
Copy link
Contributor

@rlaace423 rlaace423 commented Aug 27, 2023

I created enhanced sysinfo.py (sys_info2.py) like below.
New design, and source code refinement.

01

Also, every 4 seconds UpTime and Ip toggled automatically.
02

If CPU or Mem or Disk reach 100%, it shows more clearly.
03

Tested on

  • Display: ssd1306
  • Interface: i2c
  • Dimensions: 128 x 64
    (GeeekPi Raspberry PI NAS mini tower Kit)

fixes #159

Copy link
Collaborator

@thijstriemstra thijstriemstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! See inline comments.

@rlaace423
Copy link
Contributor Author

No problem, I'll check it out after work, takes about 9 hours later (I'm here in South Korea).

@rlaace423
Copy link
Contributor Author

@thijstriemstra

  • improved get_mem()
    • psutil.virtual_memory().percent is much more accurate and cross-platform friendly
  • improved get_ip()
    • Now it finds the most suitable IPv4 address among the network interfaces. Also, you can specify network interface name what you want to see. (network_interface_name)
      • order by up/down status, duplex mode
      • exclude loopback address
  • get_disk() -> get_disk_usage()

@rlaace423
Copy link
Contributor Author

@thijstriemstra any updates?

@thijstriemstra
Copy link
Collaborator

@thijstriemstra any updates?

I just got back from holidays, let me take a look.

Copy link
Collaborator

@thijstriemstra thijstriemstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • the qa task if failing due to some lint errors, run tox -e qa locally and/or see https://github.com/rm-hull/luma.examples/actions/runs/6017087533/job/16684187858?pr=163#step:8:24 for these errors.
  • can you add a docstring to the example with a description of the enhancements you made?
  • At first I thought this new code could replace the existing sys_info.py but not sure, maybe it's better separate like this, thoughts @rm-hull?
  • the filename is not very descriptive, maybe it could be called sys_info_extended.py or something like that.
  • the new example needs to be added to the README.md
  • add your name to CONTRIBUTING.rst

@rlaace423
Copy link
Contributor Author

I've made some edits. I'm not a Python guy, so I'm not sure if I did it correctly.

Copy link
Collaborator

@thijstriemstra thijstriemstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@thijstriemstra thijstriemstra merged commit e31accd into rm-hull:master Sep 25, 2023
5 checks passed
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

Successfully merging this pull request may close these issues.

Example IP, Temp, Memory, Disk
2 participants