now dont need to scroll
This commit is contained in:
parent
9669cc9806
commit
80223f6bf5
56
remote
56
remote
@ -15,36 +15,26 @@ launch_app() {
|
||||
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() {
|
||||
$ADB input tap $1 $2
|
||||
# sleep 1.5
|
||||
}
|
||||
|
||||
open_menu() {
|
||||
tap 10 50 # Adjust these coordinates for the menu button
|
||||
tap 50 50 # Adjust these coordinates for the menu button
|
||||
}
|
||||
|
||||
select_device() {
|
||||
case "$1" in
|
||||
1) tap 20 150 ;; # Fan
|
||||
2) tap 20 250 ;; # AC
|
||||
esac
|
||||
}
|
||||
|
||||
control_device() {
|
||||
case "$1" in
|
||||
1) tap 30 200 ;; # Power
|
||||
2) tap 30 300 ;; # Speed
|
||||
3) tap 30 400 ;; # Mode
|
||||
fan)
|
||||
open_menu
|
||||
sleep 1.5
|
||||
tap 60 200
|
||||
;; # Fan from the list
|
||||
ac)
|
||||
open_menu
|
||||
sleep 1.5
|
||||
tap 60 300
|
||||
;; # AC from the list
|
||||
esac
|
||||
}
|
||||
|
||||
@ -59,17 +49,13 @@ show_main_menu() {
|
||||
|
||||
case $choice in
|
||||
1)
|
||||
open_menu
|
||||
sleep 1.5
|
||||
tap 20 150 # Select Fan
|
||||
sleep 0.5 # Wait for menu to settle
|
||||
select_device fan # Select Fan
|
||||
sleep 0.5
|
||||
fan_menu "Fan"
|
||||
;;
|
||||
2)
|
||||
open_menu
|
||||
sleep 1.5
|
||||
tap 20 200 # Select AC (adjust coordinates as needed)
|
||||
sleep 0.5 # Wait for menu to settle
|
||||
select_device ac # Select AC (adjust coordinates as needed)
|
||||
sleep 0.5
|
||||
ac_menu "AC"
|
||||
;;
|
||||
3)
|
||||
@ -94,10 +80,14 @@ fan_menu() {
|
||||
read -n 1 -p "Enter your choice: " choice
|
||||
|
||||
case $choice in
|
||||
1) scroll up ; tap 30 200 ; fan_menu ;;
|
||||
2) scroll up ; tap 640 200 ; fan_menu ;;
|
||||
3) scroll down; tap 320 500; fan_menu ;;
|
||||
4) scroll down; tap 320 650 ; fan_menu ;;
|
||||
1) tap 100 250
|
||||
fan_menu ;;
|
||||
2) tap 950 260
|
||||
fan_menu ;;
|
||||
3) tap 540 1200
|
||||
fan_menu ;;
|
||||
4) tap 540 1400
|
||||
fan_menu ;;
|
||||
5) show_main_menu ;;
|
||||
*) echo "Invalid choice. Try Again..."; sleep 0.5; fan_menu ;;
|
||||
esac
|
||||
|
Loading…
x
Reference in New Issue
Block a user