Code: Select all
try:
dummy
except NameError:
dummy = 0
eg.globals.Ovnmodus = {
'WC':None,
'Kontor':None,
'Hovedsoverom':None,
'Gjesterom':None,
'Testrom':None
}
try:
dummy
except NameError:
dummy = 0
eg.globals.Temp1 = {
'WC':None,
'Kontor':None,
'Hovedsoverom':None,
'Gjesterom':None,
'Testrom':None
}And finally the room, which later will come from the number of the sensor, and I try to manipulate this:
Code: Select all
eg.globals.Ovnmodus['Testrom'] = 1
eg.globals.Temp1['Testrom'] = 22
Rom = "Testrom"
temp = eg.globals.Temp1[Rom]
OvnmodusRom = eg.globals.Ovnmodus[Rom]
print (OvnmodusRom)
print (temp)
Code: Select all
Traceback (most recent call last):
Python script "52", line 2, in <module>
eg.globals.Temp1['Testrom'] = 22
AttributeError: 'Bunch' object has no attribute 'Temp1'Edit: Can it be that there has to be a difference earlier in the table script because I'm using more than one list here? Because after a bit of experimenting I tried to print the contents of eg.globals.Ovnmodus and eg.globals.Temp1, and the first gave me the list of the rooms, the second gave me the Bunch error. So it seems the table just isn't created.