File tree Expand file tree Collapse file tree 7 files changed +226
-0
lines changed
commands/remote-control/denon-avr Expand file tree Collapse file tree 7 files changed +226
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/osascript
2+
3+ # Required parameters:
4+ # @raycast.schemaVersion 1
5+ # @raycast.title Configure
6+ # @raycast.mode compact
7+
8+ # Optional parameters:
9+ # @raycast.icon images/denon_logo.png
10+ # @raycast.argument1 { "type": "text", "placeholder": "Denon AVR IP" }
11+ # @raycast.argument2 { "type": "text", "placeholder": "Method (Classic or Modern)" }
12+ # @raycast.packageName Denon AVR
13+
14+ # Documentation:
15+ # @raycast.description Helperscript to configure Denon AVR Script Commands
16+ # @raycast.author Rediwed
17+ # @raycast.authorURL github.com/Rediwed
18+
19+ on run argv
20+ try
21+ checkAlive(item 1 of argv)
22+ writeIP(item 1 of argv)
23+ setMethod(item 2 of argv)
24+ log " Configuration success!"
25+ on error err_msg
26+ tell me to error " An error has occured: " & err_msg
27+ end try
28+ end run
29+
30+ on checkAlive (ip_address )
31+ try
32+ do shell script " ping -c 1 " & ip_address
33+ on error
34+ tell me to error " Ip-address " & ip_address & " is incorrect, please adjust"
35+ end try
36+ end checkAlive
37+
38+ on writeIP (ip_address )
39+ do shell script " defaults write com.Rediwed.DenonAVR ip_address " & ip_address
40+ return
41+ end writeIP
42+
43+ on setMethod (Method )
44+ set Method to (do shell script " echo " & (quoted form of Method) & " | tr '[:upper:]' '[:lower:]'" )
45+ do shell script " defaults write com.Rediwed.DenonAVR method " & Method
46+ end setMethod
Original file line number Diff line number Diff line change 1+ #! /usr/bin/osascript
2+
3+ # Required parameters:
4+ # @raycast.schemaVersion 1
5+ # @raycast.title Power Off
6+ # @raycast.mode compact
7+
8+ # Optional parameters:
9+ # @raycast.icon images/denon_logo.png
10+ # @raycast.packageName Denon AVR
11+
12+ # Documentation:
13+ # @raycast.description Powers off a modern Denon AVR if it is currently powered on
14+ # @raycast.author Rediwed
15+ # @raycast.authorURL github.com/Rediwed
16+
17+ on run
18+ set ip_address to (do shell script " defaults read com.Rediwed.DenonAVR ip_address" )
19+ if (do shell script " defaults read com.Rediwed.DenonAVR method" ) = " modern" then
20+ runModern(ip_address)
21+ else
22+ runClassic(ip_address)
23+ end if
24+ end run
25+
26+ on runModern (ip_address )
27+ do shell script " curl " & ip_address & " :8080/goform/formiPhoneAppDirect.xml?PWSTANDBY"
28+ log " Powering on..."
29+ end runModern
30+
31+ on runClassic (ip_address )
32+ # classic is not yet set-up
33+ # do shell script "curl 192.168.0.214:8080//goform/formiPhoneAppDirect.xml?MV" & (item 1 of argv)
34+ log " Classic has not yet been set-up"
35+ end runClassic
Original file line number Diff line number Diff line change 1+ #! /usr/bin/osascript
2+
3+ # Required parameters:
4+ # @raycast.schemaVersion 1
5+ # @raycast.title Power On
6+ # @raycast.mode compact
7+
8+ # Optional parameters:
9+ # @raycast.icon images/denon_logo.png
10+ # @raycast.packageName Denon AVR
11+
12+ # Documentation:
13+ # @raycast.description Powers on a modern Denon AVR if it is currently powered off
14+ # @raycast.author Rediwed
15+ # @raycast.authorURL github.com/Rediwed
16+
17+ on run
18+ set ip_address to (do shell script " defaults read com.Rediwed.DenonAVR ip_address" )
19+ if (do shell script " defaults read com.Rediwed.DenonAVR method" ) = " modern" then
20+ runModern(ip_address)
21+ else
22+ runClassic(ip_address)
23+ end if
24+ end run
25+
26+ on runModern (ip_address )
27+ do shell script " curl " & ip_address & " :8080/goform/formiPhoneAppDirect.xml?PWON"
28+ log " Powering on..."
29+ end runModern
30+
31+ on runClassic (ip_address )
32+ # classic is not yet set-up
33+ # do shell script "curl 192.168.0.214:8080//goform/formiPhoneAppDirect.xml?MV" & (item 1 of argv)
34+ log " Classic has not yet been set-up"
35+ end runClassic
Original file line number Diff line number Diff line change 1+ #! /usr/bin/osascript
2+
3+ # Required parameters:
4+ # @raycast.schemaVersion 1
5+ # @raycast.title Set Volume
6+ # @raycast.mode compact
7+
8+ # Optional parameters:
9+ # @raycast.icon images/denon_logo.png
10+ # @raycast.argument1 { "type": "text", "placeholder": "Placeholder" }
11+ # @raycast.packageName Denon AVR
12+
13+ # Documentation:
14+ # @raycast.description Sets the Denon AVR to a specific volume level (between 0 and 80)
15+ # @raycast.author Rediwed
16+ # @raycast.authorURL github.com/Rediwed
17+
18+ on run argv
19+ if 0 ² (item 1 of argv) and (item 1 of argv) ² 80 then
20+ set ip_address to (do shell script " defaults read com.Rediwed.DenonAVR ip_address" )
21+ if (do shell script " defaults read com.Rediwed.DenonAVR method" ) = " modern" then
22+ runModern(ip_address, item 1 of argv)
23+ else
24+ runClassic(ip_address, item 1 of argv)
25+ end if
26+ else
27+ log " Command not executed, illegal volume!"
28+ end if
29+ end run
30+
31+ on runModern (ip_address, volume_level )
32+ do shell script " curl " & ip_address & " :8080//goform/formiPhoneAppDirect.xml?MV" & (volume_level)
33+ log " Volume set to " & volume_level & " !"
34+ end runModern
35+
36+ on runClassic (ip_address, volume_level )
37+ # classic is not yet set-up
38+ # do shell script "curl 192.168.0.214:8080//goform/formiPhoneAppDirect.xml?MV" & (item 1 of argv)
39+ log " Classic has not yet been set-up"
40+ end runClassic
Original file line number Diff line number Diff line change 1+ #! /usr/bin/osascript
2+
3+ # Required parameters:
4+ # @raycast.schemaVersion 1
5+ # @raycast.title Volume Down
6+ # @raycast.mode compact
7+
8+ # Optional parameters:
9+ # @raycast.icon images/denon_logo.png
10+ # @raycast.packageName Denon AVR
11+
12+ # Documentation:
13+ # @raycast.description Decreases the volume of your Denon AVR by one unit
14+ # @raycast.author Rediwed
15+ # @raycast.authorURL github.com/Rediwed
16+
17+ on run
18+ set ip_address to (do shell script " defaults read com.Rediwed.DenonAVR ip_address" )
19+ if (do shell script " defaults read com.Rediwed.DenonAVR method" ) = " modern" then
20+ runModern(ip_address)
21+ else
22+ runClassic(ip_address)
23+ end if
24+ end run
25+
26+ on runModern (ip_address )
27+ do shell script " curl " & ip_address & " :8080/goform/formiPhoneAppDirect.xml?MVDOWN"
28+ log " Volume decreased!"
29+ end runModern
30+
31+ on runClassic (ip_address )
32+ # classic is not yet set-up
33+ # do shell script "curl 192.168.0.214:8080//goform/formiPhoneAppDirect.xml?MV" & (item 1 of argv)
34+ log " Classic has not yet been set-up"
35+ end runClassic
Original file line number Diff line number Diff line change 1+ #! /usr/bin/osascript
2+
3+ # Required parameters:
4+ # @raycast.schemaVersion 1
5+ # @raycast.title Volume Up
6+ # @raycast.mode compact
7+
8+ # Optional parameters:
9+ # @raycast.icon images/denon_logo.png
10+ # @raycast.packageName Denon AVR
11+
12+ # Documentation:
13+ # @raycast.description Increases the volume of your Denon AVR by one unit
14+ # @raycast.author Rediwed
15+ # @raycast.authorURL github.com/Rediwed
16+
17+ on run
18+ set ip_address to (do shell script " defaults read com.Rediwed.DenonAVR ip_address" )
19+ if (do shell script " defaults read com.Rediwed.DenonAVR method" ) = " modern" then
20+ runModern(ip_address)
21+ else
22+ runClassic(ip_address)
23+ end if
24+ end run
25+
26+ on runModern (ip_address )
27+ do shell script " curl " & ip_address & " :8080/goform/formiPhoneAppDirect.xml?MVUP"
28+ log " Volume increased!"
29+ end runModern
30+
31+ on runClassic (ip_address )
32+ # classic is not yet set-up
33+ # do shell script "curl 192.168.0.214:8080//goform/formiPhoneAppDirect.xml?MV" & (item 1 of argv)
34+ log " Classic has not yet been set-up"
35+ end runClassic
You can’t perform that action at this time.
0 commit comments