changeset 1069:c5b14fe5c387

rules updates Ignore-this: e8f0c7c412d0e685296139d5ccd19021 darcs-hash:2e05f0d714c1ccf09fa486b80686720d6fa68cf8
author drewp <drewp@bigasterisk.com>
date Thu, 14 Apr 2016 00:10:26 -0700
parents 5b7fdbc73ed5
children 1630e50d9842
files service/reasoning/actions.py service/reasoning/input/startup.n3 service/reasoning/rules.n3
diffstat 3 files changed, 16 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/service/reasoning/actions.py	Sat Apr 02 23:34:44 2016 -0700
+++ b/service/reasoning/actions.py	Thu Apr 14 00:10:26 2016 -0700
@@ -35,12 +35,14 @@
                 #(DEV.theaterDoorLock, ROOM.state),
                 #(URIRef('http://bigasterisk.com/host/bang/monitor'), ROOM.powerState),
                 (URIRef('http://bigasterisk.com/host/dash/monitor'), ROOM.powerState),
-                (URIRef('http://projects.bigasterisk.com/room/storageCeilingLedLong'), ROOM.brightness),
-                (URIRef('http://projects.bigasterisk.com/room/storageCeilingLedCross'), ROOM.brightness),
-                (URIRef('http://projects.bigasterisk.com/room/headboardWhite'), ROOM.brightness),
-                (URIRef('http://projects.bigasterisk.com/room/changingWhite'), ROOM.brightness),
-                (URIRef('http://projects.bigasterisk.com/room/starTrekLight'), ROOM.brightness),
-                (URIRef('http://projects.bigasterisk.com/room/bedLedStrip'), ROOM.color),
+                (ROOM['storageCeilingLedLong'], ROOM.brightness),
+                (ROOM['storageCeilingLedCross'], ROOM.brightness),
+                (ROOM['headboardWhite'], ROOM.brightness),
+                (ROOM['changingWhite'], ROOM.brightness),
+                (ROOM['starTrekLight'], ROOM.brightness),
+                (ROOM['livingRoomLamp1'], ROOM.brightness),
+                (ROOM['livingRoomLamp2'], ROOM.brightness),
+                (ROOM['bedLedStrip'], ROOM.color),
             ]:
             url = deviceGraph.value(dev, ROOM.putUrl)
 
--- a/service/reasoning/input/startup.n3	Sat Apr 02 23:34:44 2016 -0700
+++ b/service/reasoning/input/startup.n3	Thu Apr 14 00:10:26 2016 -0700
@@ -6,7 +6,7 @@
 <http://kitchen:9059/graph>  is :source of :reasoning; rdfs:label "kitchen pi" .
 <http://living:9059/graph>   is :source of :reasoning; rdfs:label "living room pi" .
 <http://slash:9059/graph>    is :source of :reasoning; rdfs:label "slash arduino" .
-<http://sticker:9059/graph>  is :source of :reasoning; rdfs:label "bed pi" .
+<http://bed:9059/graph>  is :source of :reasoning; rdfs:label "bed pi" .
 <http://brace6:9059/graph>   is :source of :reasoning; rdfs:label "brace arduino" .
 <http://changing:9059/graph> is :source of :reasoning; rdfs:label "changing pi" .
 
--- a/service/reasoning/rules.n3	Sat Apr 02 23:34:44 2016 -0700
+++ b/service/reasoning/rules.n3	Thu Apr 14 00:10:26 2016 -0700
@@ -157,6 +157,11 @@
   :changingWhite :brightness 0.2 .
 } .
 
-{ <http://bigasterisk.com/homeauto/sensor/motion2> :sees :motionStart } => {
+{ sensor:motionChanging :sees :motionStart } => {
   :changingCam :grab <http://bang:9057/changing.jpg> .
-  } .
\ No newline at end of file
+  } .
+
+{ :bookSwitch :buttonState :press . :livingRoomLamp1 :brightness 0.0 . } => {
+  :livingRoomLamp1 :brightness 1.0 . :livingRoomLamp2 :brightness 1.0 } .
+{ :bookSwitch :buttonState :press . :livingRoomLamp1 :brightness 1.0 . } => {
+  :livingRoomLamp1 :brightness 0.0 . :livingRoomLamp2 :brightness 0.0 } .