This commit is contained in:
2025-12-07 22:31:10 +01:00
parent 07e61dc952
commit 245e88f612

View File

@@ -692,7 +692,8 @@ def on_message(client, userdata, msg):
writeLog("Linux Vol Control") writeLog("Linux Vol Control")
if myObj['target'] == "start": if myObj['target'] == "start":
writeLog("Getting sound status") writeLog("Getting sound status")
myCmd = "sudo XDG_RUNTIME_DIR=/run/user/1000 -u jd amixer sget Master | awk -F'[][]' '/Left:/ { print $2 }'" #myCmd = "sudo XDG_RUNTIME_DIR=/run/user/1000 -u jd amixer sget Master | awk -F'[][]' '/Left:/ { print $2 }'"
myCmd = "sudo XDG_RUNTIME_DIR=/run/user/1000 -u jd amixer sget Master"
writeLog(myCmd) writeLog(myCmd)
output = subprocess.Popen(myCmd, shell=True) output = subprocess.Popen(myCmd, shell=True)
@@ -1288,8 +1289,8 @@ else:
payload[m] = 0 payload[m] = 0
client.publish( "home-assistant/" + host + "/hwstats", payload=json.dumps(payload), qos=0, retain=True) client.publish( "home-assistant/" + host + "/hwstats", payload=json.dumps(payload), qos=0, retain=True)
writeLog(FILE_TIMESTAMP) # writeLog(FILE_TIMESTAMP)
writeLog(mtime) # writeLog(mtime)
if FILE_TIMESTAMP != mtime: if FILE_TIMESTAMP != mtime:
writeLog("Script updated ! restarting...") writeLog("Script updated ! restarting...")
#os.execv(sys.executable, ['python'] + sys.argv) #os.execv(sys.executable, ['python'] + sys.argv)