Update rpi-cpu2mqtt.py
This commit is contained in:
committed by
Masoko
parent
1e7829d36b
commit
8c0c484adb
@@ -127,7 +127,7 @@ def check_rpi5_fan_speed():
|
|||||||
def get_os():
|
def get_os():
|
||||||
full_cmd = 'cat /etc/os-release | grep -i pretty_name'
|
full_cmd = 'cat /etc/os-release | grep -i pretty_name'
|
||||||
pretty_name = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0].decode("utf-8")
|
pretty_name = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0].decode("utf-8")
|
||||||
pretty_name = pretty_name.split('=')[1].replace('"', '')
|
pretty_name = pretty_name.split('=')[1].replace('"', '').replace('\n', '')
|
||||||
|
|
||||||
return(pretty_name)
|
return(pretty_name)
|
||||||
|
|
||||||
@@ -503,4 +503,4 @@ if __name__ == '__main__':
|
|||||||
if not args.service:
|
if not args.service:
|
||||||
break
|
break
|
||||||
# if running as a service, sleep before the next iteration
|
# if running as a service, sleep before the next iteration
|
||||||
time.sleep(config.service_sleep_time)
|
time.sleep(config.service_sleep_time)
|
||||||
|
|||||||
Reference in New Issue
Block a user