summaryrefslogtreecommitdiff
path: root/validation/validlib/io_group.py
diff options
context:
space:
mode:
Diffstat (limited to 'validation/validlib/io_group.py')
-rw-r--r--validation/validlib/io_group.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/validation/validlib/io_group.py b/validation/validlib/io_group.py
new file mode 100644
index 0000000000..0940775ff5
--- /dev/null
+++ b/validation/validlib/io_group.py
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+
+"""Module allowing to command and control the Anel io's"""
+
+import anellib
+
+config = {
+ #key: (IP adress, login, password)
+ 1: ("192.168.0.13", "admin", "anel")
+ }
+
+def parameters():
+ """Parameters specific to the command and control of the Anel io's"""
+ return {
+ "target":"io",
+ "switch_path":"/io.htm",
+ "status_path":"/io.htm",
+ "body":"n0=IO-1&e0=0&n1=IO-2&e1=0&n2=IO-3&e2=0&n3=IO-4&e3=0&" \
+ "n4=IO-5&e4=0&n5=IO-6&e5=0&n6=IO-7&e6=0&n7=IO-8&e7=0",
+ "letter":"E",
+ "config":config,
+ "size":8
+ }
+
+def switch(command, keys):
+ """Switch on/off of the io's specified by the keys"""
+ return anellib.switch(command, keys, parameters())
+
+def status(key):
+ """Return the status on/off of the io's specified by the keys"""
+ return anellib.status(key, parameters())
+
+def indexes():
+ """Return a list containing the index of each group of io's"""
+ return anellib.indexes(parameters())
+
+def subindexes():
+ """Return a list containing the index of each io in a group of io's"""
+ return anellib.subindexes(parameters())
+
+def switch_off_all():
+ """Switch off all io's"""
+ return anellib.switch_off_all(parameters())