mirror of
https://github.com/riptidewave93/UNVR-NAS.git
synced 2025-03-09 15:40:13 +00:00
feat: add hdds/temps/version to display
* Write a mock ustorage tool to parse disk info for ulcmd * Pass system temp info from unvr-fan-daemon to mock-ubnt-api via tmp file * add mock ubnt-tools to make ulcmd happy and report our SN * code cleanup and documentation update
This commit is contained in:
parent
a4f7f862c2
commit
9c08f287fc
7 changed files with 268 additions and 58 deletions
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/python3
|
||||
from functools import lru_cache
|
||||
|
||||
"""
|
||||
A handful of Ubiquiti Unifi device specific functions
|
||||
"""
|
||||
|
||||
UBNTHAL_PATH = "/proc/ubnthal/system.info"
|
||||
|
||||
|
||||
@lru_cache(None)
|
||||
def get_ubnt_shortname() -> str:
|
||||
try:
|
||||
with open(UBNTHAL_PATH, "r") as f:
|
||||
ubnthal_model = [i for i in f.readlines() if i.startswith("shortname=")][0]
|
||||
return ubnthal_model.lstrip("shortname=").rstrip("\n")
|
||||
except FileNotFoundError:
|
||||
print(
|
||||
f"Error: unable to open {UBNTHAL_PATH}; is the ubnthal kernel module loaded?!"
|
||||
)
|
||||
raise
|
Loading…
Add table
Add a link
Reference in a new issue