Ankündigung

Einklappen
Keine Ankündigung bisher.

- √ - Problem with logic

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

  • tfinell
    antwortet
    Thank you for your help. Digit in the name "1-ker" was reason for the error.

    Einen Kommentar schreiben:


  • Robert
    antwortet
    guess it's the digit in the name "1-ker"...

    Einen Kommentar schreiben:


  • tfinell
    antwortet
    I changed all the items to underscored, but same error occurred. I also tried other items without underscored. It gave me also same error.

    Einen Kommentar schreiben:


  • 2ndsky
    antwortet
    Maybe the parser has problems with the minus sign in your item names. Can you try to replace them with underscores and test again?

    Einen Kommentar schreiben:


  • tfinell
    hat ein Thema erstellt - √ - Problem with logic

    - √ - Problem with logic

    In the beginning I have to apologize that I am writing in english. I am using smartVISU and smarthome.py to control my home. It is working very well. Now I would like to write some logics. Here is one sample that I made, but I get errors from the logic file.

    Here are the config files:

    /items/knx.conf (part of it):
    Code:
    [1-ker]    
        [[tv-huone]]
           [[[wc-kattovalo]]]
                type = bool
                visu = yes
                knx_dpt = 1
                knx_listen = 0/6/1
                knx_send = 0/6/0
           [[[wc-seina]]]
                type = bool
                visu = yes
                knx_dpt = 1
                knx_listen = 0/6/3
                knx_send = 0/6/2
    /etc/logic.conf:
    Code:
    [autotallin_ovi]
        filename = autotallix.py
        watch_item = 1-ker.tv-huone.wc-seina # monitor for changes
    /logics/autotallix.py:
    Code:
    #!/usr/bin/env python
    if not sh.1-ker.tv-huone.wc-seina():
        sh.1-ker.tv-huone.wc-kattovalo('on')
    This is what i get from SH.py log:
    Code:
    2013-07-09 08:28:07,899 SmartHome.py DEBUG    reading logics from /usr/local/smarthome/etc/logic.conf -- logic.py:__init__:38
    2013-07-09 08:28:07,900 SmartHome.py DEBUG    Logic: autotallin_ovi -- logic.py:__init__:45
    2013-07-09 08:28:07,905 SmartHome.py WARNING  Exception: invalid syntax (autotallix.py, line 2) -- logic.py:generate_bytecode:111
    If I use this kind of logic file. Everything works.
    Code:
    #!/usr/bin/env python
    for item in sh:
        print item
        for child_item in item:
            print child_item
    What I have made wrong?
Lädt...
X