changeset 328:b069bb37f817

IR remote rule Ignore-this: 901771de421a81129f2ddf4316af91d9
author drewp@bigasterisk.com
date Sat, 03 Feb 2018 14:38:10 -0800
parents b9102d13f0a6
children 1d562167868c
files service/reasoning/actions.py service/reasoning/oneShot service/reasoning/rules.n3
diffstat 3 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/service/reasoning/actions.py	Fri Jan 26 21:23:22 2018 -0800
+++ b/service/reasoning/actions.py	Sat Feb 03 14:38:10 2018 -0800
@@ -88,6 +88,7 @@
             p = deviceGraph.value(osp, ROOM['predicate'])
             if s is None or p is None:
                 continue
+            log.info("checking for %s %s", s, p)
             for postTarget in inferred.objects(s, p):
                 log.info("post target %r", postTarget)
                 # this packet ought to have 'oneShot' in it somewhere
--- a/service/reasoning/oneShot	Fri Jan 26 21:23:22 2018 -0800
+++ b/service/reasoning/oneShot	Sat Feb 03 14:38:10 2018 -0800
@@ -7,6 +7,7 @@
 s, p, o = sys.argv[1:]
 
 prefixes = {
+    '': 'http://projects.bigasterisk.com/room/',
     'room' : 'http://projects.bigasterisk.com/room/',
     'shuttle': 'http://bigasterisk.com/room/livingRoom/shuttlepro/',
     'sensor': 'http://bigasterisk.com/homeauto/sensor/',
--- a/service/reasoning/rules.n3	Fri Jan 26 21:23:22 2018 -0800
+++ b/service/reasoning/rules.n3	Sat Feb 03 14:38:10 2018 -0800
@@ -8,6 +8,7 @@
 @prefix math: <http://www.w3.org/2000/10/swap/math#> .
 
 @prefix star: <http://bigasterisk.com/host/star/> .
+@prefix bang: <http://bigasterisk.com/host/bang/> .
 @prefix dash: <http://bigasterisk.com/host/dash/> .
 @prefix slash: <http://bigasterisk.com/host/slash/> .
 
@@ -193,3 +194,12 @@
 
 { sensor:motionBed :sees :motion . } => { :anim1 :playback :start . } .
 
+
+{ sensor:motionFrontdoorInside :seesRecently30 :motion } => {
+  <http://bigasterisk.com/host/frontdoor/monitor> :powerState :on .
+} .
+
+{ <http://projects.bigasterisk.com/room/remoteButton/KEY_POWER> :state :press } => {
+#star:slideshow :postAction <http://dash:9049/effects/question> .
+bang: :postAction <http://10.2.0.62/rpc/motor> .
+} .