mirror of
https://github.com/riptidewave93/UNVR-NAS.git
synced 2025-03-09 15:40:13 +00:00
fix: and add data to ubnteeprom (#10)
* Fixup incorrect device serial # * Add more system info about the NVRs * Start using ubnteeprom in more spots * Also do some minor BT house cleaning
This commit is contained in:
parent
9ef1a72228
commit
8e2262e121
3 changed files with 163 additions and 70 deletions
|
@ -5,17 +5,6 @@ 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
|
||||
return os.popen("ubnteeprom -systeminfo -key shortname").read().rstrip("\n")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue