humble_rpi-plugin-pir 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49d8a6fb16965f65c09f0d7756000cabf6b5d2bf
4
- data.tar.gz: e9b85102f5ac78c2103fdc6f053f539a3fec061a
3
+ metadata.gz: 1bfd39e7a20026132f7281e13c61dca45ff0a4a0
4
+ data.tar.gz: 33b9e5aa8f1f7b4121cc41dcce44aac3f42ee762
5
5
  SHA512:
6
- metadata.gz: 288384c2e150e431c4460599c900a0a031cb0d1eadd4ec7bc7955be809eea4317381bbc62708988604e6a912f458914acd684f494298100092a020bc743dd930
7
- data.tar.gz: 964170331d02739beedbc46457a4a25caad215780e52e4fba81b8caa4a1dfaf61d784e9432174566377d283c1758cb258247ca1b2d4da2684d7978e0bc30b4a6
6
+ metadata.gz: 8c836e2e892e8b32453aa4910e4fa9047f8a137773476d122d6a280b5f690d9bac5c70bb0942a15a5a633c1179f2856d8c4acad8731b2f6eb20e8622a5e5477d
7
+ data.tar.gz: e560788a10ce4a45d3de61a91845d360bc9a7832af3433fa2e9627d129f92da38a8da409f1af9d1032616aa337086b7d4df74438697d0c3c1691de95b495b1f9
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -33,22 +33,24 @@ class HumbleRPiPluginPir
33
33
  def start()
34
34
 
35
35
  count = 0
36
- t1 = Time.now - ChronicDuration.parse('1 minute and 10 seconds')
37
36
 
38
37
  duration = @duration
39
38
  notifier = @notifier
40
39
  device_id = @device_id
41
-
40
+
41
+ t1 = Time.now - (ChronicDuration.parse(duration) + 10)
42
+
43
+ puts 'ready to detect motion'
44
+
42
45
  @pins.each.with_index do |pin, i|
43
-
46
+
44
47
  after pin: pin.to_i, goes: :high do
45
48
 
46
49
  count += 1
47
-
50
+
48
51
  if Time.now > t1 + ChronicDuration.parse(duration) then
49
-
50
- notifier.notice "%s/motion/%s: " \
51
- + "detected %s times within the past %s" \
52
+
53
+ notifier.notice "%s/motion/%s: detected %s times within the past %s" \
52
54
  % [device_id, i, count, duration]
53
55
  t1 = Time.now
54
56
  count = 0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: humble_rpi-plugin-pir
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  sZmb/8bK00PWuk0XFH654xoL460Lx6jtyKxF+AGbl41ABU8/37TLpQ4JR+zak1pD
32
32
  6ChqgwUNdmh5Tw==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-06-13 00:00:00.000000000 Z
34
+ date: 2015-06-14 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: pi_piper
@@ -73,7 +73,8 @@ dependencies:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: 0.10.6
76
- description: This plugin can be tested in isolation with the Raspberry Pi.
76
+ description: A humble_rpi plugin which detects motion for 1 or more PIR sensor. This
77
+ plugin can be tested in isolation with the Raspberry Pi.
77
78
  email: james@r0bertson.co.uk
78
79
  executables: []
79
80
  extensions: []
metadata.gz.sig CHANGED
Binary file