Seite 1 von 1

Validation issues OH3

Verfasst: 10. Mär 2021 11:04
von SaschaQ
Hallo zusammen,

ich habe seit OH3 beim Laden der Rules die folgenden Hinweise im Log: Weiß jemand was ich verändern muss? Die Rules laufen alle einwandfrei.

Code: Alles auswählen


2021-03-10 11:02:20.391 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'pollenflug.rules', using it anyway:

There is no context to infer the closure's argument types from. Consider typing the arguments or put the closures into a typed context.

There is no context to infer the closure's argument types from. Consider typing the arguments or put the closures into a typed context.

There is no context to infer the closure's argument types from. Consider typing the arguments or put the closures into a typed context.

There is no context to infer the closure's argument types from. Consider typing the arguments or put the closures into a typed context.



Hier die Rule Datei:

Code: Alles auswählen


rule "Pollenwarnung NRW Sascha"
when
    Time cron "30 10 6,13,20 * * ?" // fixe Zeiten 06:10:30, 13:10:30, 20:10:30
                                    // die Zeiten sind willkürlich gewählt...
then
    gPollen.members.filter[i|i.name.split("_").get(2) == "0"].forEach[p|
        var String strMessage = "Achtung! Pollenflugvorhersage für "
        var String strSorte = p.name.split("_").get(1)
        strMessage = strMessage + strSorte + ": "
        gPollen.members.filter[j|j.name.split("_").get(1) == strSorte && j.state.toString != "-1" && j.state.toString != "0"].sortBy[name].forEach[q|
//      gPollen.members.filter[j|j.name.split("_").get(1) == strSorte && j.state.toString != "-1"].sortBy[name].forEach[q|
            if(strMessage.endsWith(" Pollenflug"))
                strMessage = strMessage + "; "
            switch (q.name.split("_").get(2)) {
                case "0" : strMessage = strMessage + "Heute "
                case "1"   : strMessage = strMessage + "Morgen "
                case "2"   : strMessage = strMessage + "Übermorgen "
            }
            switch (q.state.toString) {
                case "0"   : strMessage = strMessage + "kein"
                case "0-1" : strMessage = strMessage + "kein bis niedriger"
                case "1"   : strMessage = strMessage + "niedriger"
                case "1-2" : strMessage = strMessage + "niedriger bis mittlerer"
                case "2"   : strMessage = strMessage + "mittlerer"
                case "2-3" : strMessage = strMessage + "mittlerer bis starker"
                case "3"   : strMessage = strMessage + "starker"
            }
            strMessage = strMessage + " Pollenflug"
        ]
        strMessage = strMessage + "."
        if(strMessage.endsWith(" Pollenflug."))  // diese Zeile gegebenenfalls auskommentieren
            sendBroadcastNotification(strMessage)
//        else {
//            strMessage = "Achtung! Pollenflugvorhersage für "+strSorte+": Kein Pollenflug."
//            sendBroadcastNotification(strMessage)
//        }
    ]
end



Re: Validation issues OH3

Verfasst: 10. Mär 2021 14:20
von int5749
Hm, wie sehen denn die zugrunde liegenden Items dafür aus??

Re: Validation issues OH3

Verfasst: 10. Mär 2021 21:55
von udo1toni
Die Meldung hat in dem Kontext für mich keinen Sinn. Ist das die gesamte Datei pollenflug.rules?

Die Meldung ist erst mal nur eine Information, sollte also nicht verhindern, dass die Rule (fehlerfrei) arbeitet.