Hallo,
hab schon gegooglet, gab leider nur 3 Ergebnisse, nur einer hat es gelöst und der hat die Lösung nicht verraten.
Nutze den Switchbot von Sanii. Funktioniert soweit, außer das Laden von Konfigurationen.
Syserr:
Python
- 0126 18:54:32173 :: Traceback (most recent call last):
- 0126 18:54:32173 :: File "ui.py", line 1949, in CallEvent
- 0126 18:54:32173 :: File "ui.py", line 90, in __call__
- 0126 18:54:32173 :: File "ui.py", line 72, in __call__
- 0126 18:54:32173 :: File "uiSwitchbot.py", line 1484, in __OnSave
- 0126 18:54:32173 :: File "uiSwitchbot.py", line 1354, in LoadConfigurations
- 0126 18:54:32174 :: AttributeError
- 0126 18:54:32174 :: :
- 0126 18:54:32174 :: __exit__
- 0126 18:54:32174 ::
Die entsprechende Funktion:
Python
- def LoadConfigurations(self):
- try:
- with open('switchbot.pkl', 'rb') as f:
- self.dict = pickle.load(f)
- except IOError:
- self.dict = {}
- self.listBox.RemoveAllItems()
- lineWidth = self.listBox.GetWidth()
- if len(self.dict) > self.__GetViewItemCount():
- lineWidth -= 20
- self.__AdjustScrollbar()
- for key in self.dict.iterkeys():
- config = self.dict.get(key, None)
- if not config:
- continue
- line = self.ConfigurationLine(lineWidth)
- line.Load(key, config["name"])
- line.SetLoadEvent(ui.__mem_func__(self.__OnApplyConfiguration))
- line.SetDeleteEvent(ui.__mem_func__(self.__OnDeleteConfiguration))
- self.listBox.AppendItem(line)
- self.listItems[key] = line
Es geht um die Line "with open('switchbot.pkl', 'rb') as f:"
Jemand eine Ahnung?