Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using gpiozero to read temperature #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kconkas
Copy link

@kconkas kconkas commented Jul 22, 2020

Fixes #13 (which is still present)

@Gadgetoid
Copy link
Member

Thanks for making this a PR.

However! It looks like the CPUTemperature class does nothing but read /sys/class/thermal/thermal_zone0/temp, which we'd be better positioned to do directly without the additional dependency.

This is ruminated about in #73 - I think just adding the code in the linked issue modified to match the CPUTemperature class from gpiozero would suffice:

def get_cpu_temp():
    with open("/sys/class/thermal/thermal_zone0/temp", "r") as f:
        return float(f.readline().strip()) / 1000

I know it's been a while since you raised this- but would you prefer to make this change so I can merge this PR? I like the Git history to reflect credit where credit is due.

@Gadgetoid Gadgetoid added this to the Overhaul automatic.py milestone Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with psutil - Doesn't detect SoC temperature sensor if another temperature sensor exists.
2 participants