Export SMC data in HW Diagnostics

Addresses issue #154
This commit is contained in:
2Shirt 2021-04-06 15:53:19 -06:00
parent 8e5d350ac2
commit 61f2b00a2a
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -352,6 +352,21 @@ class State():
_f.write(f'\n{name}:\n')
_f.write('\n'.join(debug.generate_object_report(test, indent=1)))
# SMC
if os.path.exists('/.wk-live-macos'):
data = []
try:
proc = exe.run_program(['smc', '-f'])
data.extend(proc.stdout.splitlines())
data.append('----')
proc = exe.run_program(['smc', '-l'])
data.extend(proc.stdout.splitlines())
except Exception: # pylint: disable=broad-except
LOG.ERROR('Error(s) encountered while exporting SMC data')
data = [line.strip() for line in data]
with open(f'{debug_dir}/smc.data', 'a') as _f:
_f.write('\n'.join(data))
def update_progress_pane(self):
"""Update progress pane."""
report = []