Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > db8d50b45fb15e865b7becf99650beea > files > 16

powerman-2.3.25-1.mga7.armv7hl.rpm

#
# Baytech RPC22-20
#
# Default config, then disable confirmation, and disable status menu.
#
# Firmware version: F1.10 (C) 2000
#
# Maybe it is accumulated serial noise or some other issue, but this
# model seems to require a little handshake:
#              send "\r\n"
#              expect ".*RPC-22>"
# before each command to avoid dropping the command.
#
specification "baytech-rpc22" {
       timeout         10   # about 5 sec for cycle command

       plug name { "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" }

       script login {
               send "\r\n"
               expect ".*RPC-22>"
       }
       script logout {
               send "\r\n"
               expect ".*RPC-22>"
               send "exit\r\n"
       }
       script status_all {
               send "\r\n"
               expect ".*RPC-22>"
               send "status\r\n"
               foreachplug {
                       expect "Outlet[ ]+([0-9]+)[^:0-9]+: (On|Off)"
                       setplugstate $1 $2 on="On" off="Off"
               }
               expect "RPC-22>"
       }
       script on {
               send "\r\n"
               expect ".*RPC-22>"
               send "on %s\r\n"
               expect "RPC-22>"
       }
       script on_all {
               send "\r\n"
               expect ".*RPC-22>"
               send "on 0\r\n"
               expect "RPC-22>"
       }
       script off {
               send "\r\n"
               expect ".*RPC-22>"
               send "off %s\r\n"
               expect "RPC-22>"
       }
       script off_all {
               send "\r\n"
               expect ".*RPC-22>"
               send "off 0\r\n"
               expect "RPC-22>"
       }
       script cycle {
               send "\r\n"
               expect ".*RPC-22>"
               send "off %s\r\n"
               expect "RPC-22>"
               delay 2
               send "on %s\r\n"
               expect "RPC-22>"
       }
       script cycle_all {
               send "\r\n"
               expect ".*RPC-22>"
               send "off 0\r\n"
               expect "RPC-22>"
               delay 2
               send "on 0\r\n"
               expect "RPC-22>"
       }
}