asitop icon indicating copy to clipboard operation
asitop copied to clipboard

fix: restore compatibility with macOS 12 Monterey

Open henrysingleton opened this issue 2 years ago • 3 comments

Fixes #51 where the power usage key was renamed from package_energy to combined_power in macOS Ventura, resulting in the following error when attempting to run asitop under Monterey:

[3/3] Waiting for first reading...

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/asitop/utils.py", line 18, in parse_powermetrics
    cpu_metrics_dict = parse_cpu_metrics(powermetrics_parse)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/asitop/parsers.py", line 133, in parse_cpu_metrics
    cpu_metric_dict["package_W"] = cpu_metrics["combined_power"]/1000
                                   ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'combined_power'

henrysingleton avatar Feb 01 '23 05:02 henrysingleton

Fixes #51

emidln-imc avatar Feb 01 '23 14:02 emidln-imc

@tlkh could we please merge in this fix?

chrisgervang avatar Jul 18 '23 18:07 chrisgervang

bump @tlkh

mathdroid avatar Dec 13 '23 14:12 mathdroid