aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/NimManager.py
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2010-10-10 12:50:53 +0200
committerghost <andreas.monzner@multimedia-labs.de>2010-10-10 14:23:43 +0200
commiteca7d386b015423112c83badcdb3e4f7e6affe6e (patch)
tree9309ba240c13d8f5d5bff5120b48a9c501aff741 /lib/python/Components/NimManager.py
parentaed83aaddeb4782046a204d7a6884c3a9bdf47a3 (diff)
parentfe72b7929c2f0b5dbac3040b303d195923735fc8 (diff)
downloadenigma2-eca7d386b015423112c83badcdb3e4f7e6affe6e.tar.gz
enigma2-eca7d386b015423112c83badcdb3e4f7e6affe6e.zip
Merge remote branch 'origin/bug_593_i2c_device_from_file' into experimental
this merge and bug 587 needs new drivers!!
Diffstat (limited to 'lib/python/Components/NimManager.py')
-rw-r--r--lib/python/Components/NimManager.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/python/Components/NimManager.py b/lib/python/Components/NimManager.py
index 79099ecb..1aff8663 100644
--- a/lib/python/Components/NimManager.py
+++ b/lib/python/Components/NimManager.py
@@ -481,7 +481,8 @@ class SecConfigure:
self.update()
class NIM(object):
- def __init__(self, slot, type, description, has_outputs = True, internally_connectable = None, multi_type = {}, frontend_id = None):
+ def __init__(self, slot, type, description, has_outputs = True, internally_connectable = None, multi_type = {}, frontend_id = None, i2c = None):
+
self.slot = slot
if type not in ("DVB-S", "DVB-C", "DVB-T", "DVB-S2", None):
@@ -493,6 +494,7 @@ class NIM(object):
self.has_outputs = has_outputs
self.internally_connectable = internally_connectable
self.multi_type = multi_type
+ self.i2c = i2c
self.frontend_id = frontend_id
def isCompatible(self, what):
@@ -530,6 +532,9 @@ class NIM(object):
def getSlotID(self):
return chr(ord('A') + self.slot)
+ def getI2C(self):
+ return self.i2c
+
def hasOutputs(self):
return self.has_outputs
@@ -714,6 +719,9 @@ class NimManager:
modes = entries[current_slot].get("multi_type", {})
modes[split2[1]] = split[1].strip()
entries[current_slot]["multi_type"] = modes
+ elif line.strip().startswith("I2C_Device:"):
+ input = int(line.strip()[len("I2C_Device:") + 1:])
+ entries[current_slot]["i2c"] = input
elif line.strip().startswith("empty"):
entries[current_slot]["type"] = None
entries[current_slot]["name"] = _("N/A")
@@ -725,6 +733,8 @@ class NimManager:
if not (entry.has_key("name") and entry.has_key("type")):
entry["name"] = _("N/A")
entry["type"] = None
+ if not (entry.has_key("i2c")):
+ entry["i2c"] = None
if not (entry.has_key("has_outputs")):
entry["has_outputs"] = True
if entry.has_key("frontend_device"): # check if internally connectable
@@ -736,7 +746,8 @@ class NimManager:
entry["frontend_device"] = entry["internally_connectable"] = None
if not (entry.has_key("multi_type")):
entry["multi_type"] = {}
- self.nim_slots.append(NIM(slot = id, description = entry["name"], type = entry["type"], has_outputs = entry["has_outputs"], internally_connectable = entry["internally_connectable"], multi_type = entry["multi_type"], frontend_id = entry["frontend_device"]))
+ self.nim_slots.append(NIM(slot = id, description = entry["name"], type = entry["type"], has_outputs = entry["has_outputs"], internally_connectable = entry["internally_connectable"], multi_type = entry["multi_type"], frontend_id = entry["frontend_device"], i2c = entry["i2c"]))
+
def hasNimType(self, chktype):
for slot in self.nim_slots:
@@ -758,6 +769,9 @@ class NimManager:
def getNim(self, slotid):
return self.nim_slots[slotid]
+
+ def getI2CDevice(self, slotid):
+ return self.nim_slots[slotid].getI2C()
def getNimListOfType(self, type, exception = -1):
# returns a list of indexes for NIMs compatible to the given type, except for 'exception'