Ankündigung

Einklappen
Keine Ankündigung bisher.

Codeblock Problem mit Plugins

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    [callidomus] Codeblock Problem mit Plugins

    Hmm, immer wenn ich bei einem Item z.B.:
    Code:
    cd.plugins.netzwerk.udp(....)
    eingebe, dann wird beim Speichern das "cd." gelöscht.

    Und dann geht der Codeblock nicht:
    Code:
    2017-11-18 15:25:46 ERROR    Funksteckdosen.System1.TasteF-code <bound method Item.__code_run of Node: Funksteckdosen.System1.TasteF>: 'str' object has no attribute 'id'
    Traceback (most recent call last):
      File "/mfs/core/lib/config.py", line 263, in __call__
        exec(self.bytecode, self.locals)
      File "<string>", line 1, in <module>
    NameError: name 'plugins' is not defined
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/mfs/core/lib/scheduler.py", line 421, in _worker
        obj(value, trigger)
      File "/mfs/core/lib/item.py", line 431, in __code_run
        value = self._codeobj(value, trigger)
      File "/mfs/core/lib/config.py", line 274, in __call__
        self.node.id, tb[1], tb[2], e, self.code))
    AttributeError: 'str' object has no attribute 'id'
    Was ist denn das für ein Problem?

    Danke!
    Thorsten

    #2
    Hi,
    das hat aber schon mal so ähnlich funktioniert....
    https://knx-user-forum.de/forum/supp...llidomus/page2

    Kannst ja mal probieren ob es was bringt wenn man das netzwerk nicht unter plugins hat sondern im Root folder.

    Vg
    Jürgen

    Kommentar


      #3
      Hi Thorsten,

      das Problem besteht schon länger. Das "cd." wird abgeschnitten und damit funktioniert die Codeblock-Logik nicht. Marcus kennt das Problem. Ich habe mir beholfen, in dem ich im Codeblock eine Logik aufrufe, die ich als externes Python-Script abgelegt habe. Ist nicht so schön, funktioniert aber, da du im externen Python-Script "cd." verwenden kannst.

      Gruß
      Thomas

      Kommentar

      Lädt...
      X