Alwinator / aw-watcher-utilization

An Activity Watch watcher that monitors CPU, RAM, disk, network, and sensor usage.
Mozilla Public License 2.0
63 stars 2 forks source link

`psutil` has no attribute `sensors_temperatures` on windows #3

Closed mt3o closed 2 years ago

mt3o commented 2 years ago

There is a bug in the implementation. Watcher tries to read temperature sensors from psutil, however psutil marks this call as linux-only. Refer to: psutil sensors_temperatures Please fix, probably mark this call as optional? Or use another tool to read sensors on windows? I guess similar problem happens on osx.

Here are the logs:

2022-04-22 07:42:01 [INFO ]: aw-watcher-utilization started  (aw_watcher_utilization.watcher:26)
2022-04-22 07:42:53 [INFO ]: Connection to aw-server established by aw-watcher-utilization  (aw_client.client:419)
2022-04-22 07:42:53 [ERROR]: Unhandled exception  (root:43)
Traceback (most recent call last):
  File "aw_watcher_utilization\__init__.py", line 28, in <module>
  File "aw_watcher_utilization\__init__.py", line 24, in main
  File "aw_watcher_utilization\watcher.py", line 35, in run
  File "aw_watcher_utilization\watcher.py", line 48, in heartbeat_loop
  File "aw_watcher_utilization\util.py", line 22, in get_utilization
AttributeError: module 'psutil' has no attribute 'sensors_temperatures'
Alwinator commented 2 years ago

@mt3o Thank you for reporting! I will fix it today.

Alwinator commented 2 years ago

@mt3o The bug should be fixed! Please try the new version (v1.1.0) and inform me if it works as expected.

mt3o commented 2 years ago

I think it works now. Thanks for very quick reaction!