myfirmata-plugin-pir 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5a70abe759f5dbc59039f5ae6727453a0d5c177
4
- data.tar.gz: ac2f386b1a3beda251599f4023bd1d63be635ed0
3
+ metadata.gz: 24a6033acea1d918f99f722db7edb6c3de1afc80
4
+ data.tar.gz: c32aed2902c2db06510754f553d06b79f8c8b682
5
5
  SHA512:
6
- metadata.gz: 85de8fea78496e247b309e2bf6458455b910f749c2951362d020d412ed34b79eaad435f963dde2130ac1664ce74231381d593dcac8958e0e78af82787d34b457
7
- data.tar.gz: f295eb7b11d5cfc60cb8ed07b40c4b4e58bf7ce093e4b045e275977feff14a447682e6aed64d9afc9d26ea2825c8dab27df7fefe02d199d2a877cc87d5001620
6
+ metadata.gz: 3a61e8fea855c9cb7188a91bcb7c664486930f861bb71010adb45e0a69e9d442fe5eba90ac55dcc1d3daf6ed60924744550c7408011d5324c5b4600c08cfd5a8
7
+ data.tar.gz: 3054ca7ae0774dca0c5351a421d2ff894007753fd494a7cfae7fe49d42e1cd5269f91f1dbdc800f80deb6abbe3a8350457ee91cc99568cb018f91d714fd47b13
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -32,8 +32,9 @@ class MyFirmataPluginPir
32
32
  duration = @duration
33
33
  notifier = @variables[:notifier]
34
34
  topic = @variables[:device_id]
35
- msg = @settings[:msg] || 'motion'
35
+ msg = @settings[:msg] || 'motion'
36
36
  pinx = @pinx
37
+ threshold = @settings[:threshold] || 5
37
38
 
38
39
  t1 = Time.now - (ChronicDuration.parse(duration) + 10)
39
40
 
@@ -47,9 +48,11 @@ class MyFirmataPluginPir
47
48
 
48
49
  if Time.now > t1 + ChronicDuration.parse(duration) then
49
50
 
50
- notifier.notice \
51
- "%s/motion: detected %s times within the past %s" % \
52
- [topic, count, duration]
51
+ if count > threshold then
52
+ notifier.notice \
53
+ "%s/motion: detected %s times within the past %s" % \
54
+ [topic, count, duration]
55
+ end
53
56
  t1 = Time.now
54
57
  count = 0
55
58
  end
@@ -61,4 +64,4 @@ class MyFirmataPluginPir
61
64
 
62
65
  alias on_start start
63
66
 
64
- end
67
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myfirmata-plugin-pir
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  qMYLyGZ6oqlJmCNJX+A9uVxKxLexn/B/52sLuZG+r6bZ0zGkKX1nmazfaBg7FM/4
32
32
  RFgXKXS9Q8TOzA==
33
33
  -----END CERTIFICATE-----
34
- date: 2017-04-15 00:00:00.000000000 Z
34
+ date: 2017-05-09 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: chronic_duration
metadata.gz.sig CHANGED
Binary file