Compare commits

..

19 Commits

Author SHA1 Message Date
87d82d8f73 build 2025-12-07 22:49:08 +01:00
7d0da9241e build 2025-12-07 22:47:09 +01:00
2c892fd6fa build 2025-12-07 22:44:32 +01:00
1e0a172cb9 build 2025-12-07 22:41:19 +01:00
69ddbe559b build 2025-12-07 22:33:43 +01:00
245e88f612 build 2025-12-07 22:31:10 +01:00
07e61dc952 build 2025-12-07 22:27:58 +01:00
bb3de5c241 build 2025-12-07 22:25:03 +01:00
e428b18e42 build 2025-12-07 22:20:43 +01:00
f747536496 build 2025-12-07 22:19:04 +01:00
ebfb825cfe build 2025-12-07 22:16:35 +01:00
796eae1859 build 2025-12-07 22:15:00 +01:00
2c7be24654 Merge branch 'main' of gitlab.sectorq.eu:jaydee/mqtt_srv 2025-12-07 22:12:26 +01:00
5b05f1ac61 build 2025-12-07 22:12:22 +01:00
9ed37997a0 Update .gitlab-ci.yml file 2025-12-07 22:07:14 +01:00
3f132c1f89 Update .gitlab-ci.yml file 2025-12-07 22:06:47 +01:00
facb016fc3 build 2025-12-07 22:04:58 +01:00
6951eebf09 build 2025-12-07 21:46:47 +01:00
b361e043c5 build 2025-12-07 21:46:10 +01:00
2 changed files with 23 additions and 5 deletions

View File

@@ -8,5 +8,6 @@ build-job: # This job runs in the build stage, which runs first.
- column=":" - column=":"
- echo "${flow_id}" - echo "${flow_id}"
- curl -X POST https://kestra.sectorq.eu/api/v1/executions/webhook/jaydee/ansible-all/${flow_id} -d '{"tag":["mqtt-srv"],"target":["morefine.home.lan"]}' -H "Content-Type${column} application/json" - curl -X POST https://kestra.sectorq.eu/api/v1/executions/webhook/jaydee/ansible-all/${flow_id} -d '{"tag":["mqtt-srv"],"target":["morefine.home.lan"]}' -H "Content-Type${column} application/json"
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/mqtt_srv.tmp/.gitlab-runner.ext.conf
rules: rules:
- if: '$CI_COMMIT_MESSAGE =~ /build/' - if: '$CI_COMMIT_MESSAGE =~ /build/'

View File

@@ -691,9 +691,26 @@ def on_message(client, userdata, msg):
else: else:
writeLog("Linux Vol Control") writeLog("Linux Vol Control")
if myObj['target'] == "start": if myObj['target'] == "start":
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"
writeLog(myCmd)
output = subprocess.Popen(myCmd, shell=True)
cmd = """sudo XDG_RUNTIME_DIR=/run/user/1000 -u jd amixer sget Master | awk -F'[][]' '/Left:/ { print $2 }'"""
result = subprocess.run(
cmd,
shell=True,
capture_output=True,
text=True
)
os.environ["MQTT_SRV_CUR_VOLUME"] = result.stdout.strip()
writeLog(f"Status of volume {os.environ["MQTT_SRV_CUR_VOLUME"]}")
myCmd = f'sudo XDG_RUNTIME_DIR=/run/user/1000 -u jd amixer set Master 20%' myCmd = f'sudo XDG_RUNTIME_DIR=/run/user/1000 -u jd amixer set Master 20%'
else: else:
myCmd =f'sudo XDG_RUNTIME_DIR=/run/user/1000 -u jd amixer set Master 100%' myCmd =f'sudo XDG_RUNTIME_DIR=/run/user/1000 -u jd amixer set Master {os.environ["MQTT_SRV_CUR_VOLUME"] }'
# try: # try:
# #percent = 20 # #percent = 20
# #output = subprocess.run(["pactl", "set-sink-volume", "@DEFAULT_SINK@", f"{percent}%"], check=True) # #output = subprocess.run(["pactl", "set-sink-volume", "@DEFAULT_SINK@", f"{percent}%"], check=True)
@@ -1278,8 +1295,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)