Skip to content

Commit

Permalink
Merge pull request #841 from theophile/theophile
Browse files Browse the repository at this point in the history
Change method of SBC model detection
  • Loading branch information
theyosh authored Oct 10, 2023
2 parents 434c107 + b63495e commit 984e13c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions terrariumEngine.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(self, version):
self.update_available = False
self.weather = None
# Dirty hack... :(
self.device = re.search(r"Model\s+:\s+(?P<device>.*)", Path("/proc/cpuinfo").read_text()).group("device")
self.device = Path("/proc/device-tree/model").read_text().rstrip('\x00')
init_db(self.version)

# Send message that startup is ready..... else the startup will wait until done.... can take more then 1 minute
Expand Down Expand Up @@ -282,9 +282,7 @@ def load_settings(self):

# Load device information
try:
settings["device"] = re.search(r"Model\s+:\s+(?P<device>.*)", Path("/proc/cpuinfo").read_text()).group(
"device"
)
settings["device"] = Path("/proc/device-tree/model").read_text().rstrip('\x00')
except Exception as ex:
logger.debug(f"Error getting Pi info: {ex}")
settings["device"] = "Unknown"
Expand Down

0 comments on commit 984e13c

Please sign in to comment.