Mercurial > code > home > repos > homeauto
diff service/reasoning/actions.py @ 1266:ee5698ef64dd
add separate :matchPredicate support. some build and log edits.
Ignore-this: acdab8c2859e5f8622b491228d0c74dd
darcs-hash:564fab06788fee02dbb69e33c087085313fc24e1
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Sat, 20 Apr 2019 23:36:30 -0700 |
parents | d8acab2b01f5 |
children | a34dee00a989 |
line wrap: on
line diff
--- a/service/reasoning/actions.py Sat Apr 20 23:35:46 2019 -0700 +++ b/service/reasoning/actions.py Sat Apr 20 23:36:30 2019 -0700 @@ -103,10 +103,12 @@ for stmt in inferred: putUrl = deviceGraph.value(stmt[0], ROOM['putUrl']) putPred = deviceGraph.value(stmt[0], ROOM['putPredicate']) - if putUrl and putPred == stmt[1]: + matchPred = deviceGraph.value(stmt[0], ROOM['matchPredicate'], + default=putPred) + if putUrl and matchPred == stmt[1]: self._put(putUrl + '?' + urllib.urlencode([ ('s', str(stmt[0])), - ('p', str(stmt[1]))]), + ('p', str(putPred))]), str(stmt[2].toPython()), agent=agentFor.get(stmt[0], None))