now dont need to scroll

This commit is contained in:
Shihaam Abdul Rahman 2024-09-17 13:20:18 +05:00
parent 9669cc9806
commit 80223f6bf5
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636

56
remote
View File

@ -15,36 +15,26 @@ launch_app() {
sleep 1.5 sleep 1.5
} }
scroll() {
case $1 in
up) $ADB input swipe 800 400 800 500 100 ;;
down) $ADB input swipe 800 500 800 400 100 ;;
*) echo "Invalid direction. Use 'up' or 'down'." ; exit 1 ;;
esac
sleep 0.5
}
tap() { tap() {
$ADB input tap $1 $2 $ADB input tap $1 $2
# sleep 1.5
} }
open_menu() { open_menu() {
tap 10 50 # Adjust these coordinates for the menu button tap 50 50 # Adjust these coordinates for the menu button
} }
select_device() { select_device() {
case "$1" in case "$1" in
1) tap 20 150 ;; # Fan fan)
2) tap 20 250 ;; # AC open_menu
esac sleep 1.5
} tap 60 200
;; # Fan from the list
control_device() { ac)
case "$1" in open_menu
1) tap 30 200 ;; # Power sleep 1.5
2) tap 30 300 ;; # Speed tap 60 300
3) tap 30 400 ;; # Mode ;; # AC from the list
esac esac
} }
@ -59,17 +49,13 @@ show_main_menu() {
case $choice in case $choice in
1) 1)
open_menu select_device fan # Select Fan
sleep 1.5 sleep 0.5
tap 20 150 # Select Fan
sleep 0.5 # Wait for menu to settle
fan_menu "Fan" fan_menu "Fan"
;; ;;
2) 2)
open_menu select_device ac # Select AC (adjust coordinates as needed)
sleep 1.5 sleep 0.5
tap 20 200 # Select AC (adjust coordinates as needed)
sleep 0.5 # Wait for menu to settle
ac_menu "AC" ac_menu "AC"
;; ;;
3) 3)
@ -94,10 +80,14 @@ fan_menu() {
read -n 1 -p "Enter your choice: " choice read -n 1 -p "Enter your choice: " choice
case $choice in case $choice in
1) scroll up ; tap 30 200 ; fan_menu ;; 1) tap 100 250
2) scroll up ; tap 640 200 ; fan_menu ;; fan_menu ;;
3) scroll down; tap 320 500; fan_menu ;; 2) tap 950 260
4) scroll down; tap 320 650 ; fan_menu ;; fan_menu ;;
3) tap 540 1200
fan_menu ;;
4) tap 540 1400
fan_menu ;;
5) show_main_menu ;; 5) show_main_menu ;;
*) echo "Invalid choice. Try Again..."; sleep 0.5; fan_menu ;; *) echo "Invalid choice. Try Again..."; sleep 0.5; fan_menu ;;
esac esac