1
0
mirror of https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks.git synced 2025-09-03 13:12:44 +02:00

Adds the current motor position to the api systeminfo. (#1579)

This commit is contained in:
Thomas Pauli
2020-09-15 23:41:54 +02:00
committed by GitHub
parent 2946d03a0e
commit 11270522ab

View File

@@ -13,6 +13,7 @@ CONFIGPATH=/system/sdcard/config
BINPATH=/system/sdcard/bin
SDPATH=/system/sdcard
VERSION="v0.0.5 Beta"
MOTOR=/system/sdcard/bin/motor.bin
# END VARIABLES
# START FUNCTIONS
@@ -149,6 +150,10 @@ if [ -n "$F_action" ]; then
\"total\": $(cat /proc/meminfo | tr -s ' ' $'\t' | grep SwapTotal: | cut -f2),
\"free\": $(cat /proc/meminfo | tr -s ' ' $'\t' | grep SwapFree: | cut -f2)
}
},
\"motor\": {
\"x\": $($MOTOR -d s | sed -n '1 p' | awk '{print $2}'),
\"y\": $($MOTOR -d s | sed -n '2 p' | awk '{print $2}')
}
}
}"