Space Panda

tuxedo_temperatures.py

Source

#!/usr/bin/env python
# needs dbus
# can be installed through pip: pip install dbus-python
import dbus
INTERFACE = 'com.tuxedocomputers.tccd'
PATH = '/com/tuxedocomputers/tccd'
def main():
    bus = dbus.SystemBus()
    proxy = bus.get_object(INTERFACE, PATH)
    iface = dbus.Interface(proxy, INTERFACE)
    cpu_fan = iface.GetFanDataCPU()
    gpu1_fan = iface.GetFanDataGPU1()
    gpu2_fan = iface.GetFanDataGPU2()
    version = iface.TccdVersion()
    webcam = iface.WebcamSWAvailable()
    webcam_status = iface.GetWebcamSWStatus()
    wmi = iface.TuxedoWmiAvailable()
    print(f"TCCD version {version}")
    print(f"CPU: {cpu_fan['temp']['data']}°C, fan at {cpu_fan['speed']['data']}%")
    print(f"GPU1: {gpu1_fan['temp']['data']}°C, fan at {gpu1_fan['speed']['data']}%")
    print(f"GPU2: {gpu2_fan['temp']['data']}°C, fan at {gpu2_fan['speed']['data']}%")
if __name__ == '__main__':
    main()