Implement the port-chagned logical in DLI functions instead of config files
Change-Id: Iec309f51aba56693a9c6d9cc93a6ee4e941523d5
diff --git a/libraries/power_switch.robot b/libraries/power_switch.robot
index 19c5974..b33f813 100644
--- a/libraries/power_switch.robot
+++ b/libraries/power_switch.robot
@@ -85,6 +85,8 @@
Enable DLI Switch Outlet
[Arguments] ${outlet_number}
[Documentation] Enable specific outlet of DLI power switch
+ # Port number starts from 0 in DLI API
+ ${outlet_number}= Evaluate ${outlet_number}-1
${resp}= Put Request alias=${alias_name} uri==${outlet_number}/state/ data=value=true
Should Be Equal As Strings ${resp.status_code} 207
Wait Until Keyword Succeeds ${timeout} 2s
@@ -100,6 +102,8 @@
Disable DLI Switch Outlet
[Arguments] ${outlet_number}
[Documentation] Disable specific outlet of DLI Power Switch
+ # Port number starts from 0 in DLI API
+ ${outlet_number}= Evaluate ${outlet_number}-1
${resp}= Put Request alias=${alias_name} uri==${outlet_number}/state/ data=value=false
Should Be Equal As Strings ${resp.status_code} 207
Wait Until Keyword Succeeds ${timeout} 2s
@@ -115,6 +119,8 @@
Check Expected DLI Switch Outlet Status
[Arguments] ${outlet_number} ${status}
[Documentation] Succeeds if the status of the desired DLI switch outlet is expected
+ # Port number starts from 0 in DLI API
+ ${outlet_number}= Evaluate ${outlet_number}-1
${resp}= Get Request alias=${alias_name} uri==${outlet_number}/state/
Should Be Equal As Strings ${resp.text} [${status}]