humble_rpi-plugin-dhtsensor 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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +2 -1
- data/lib/humble_rpi-plugin-dhtsensor.rb +10 -5
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 519cd5db8ea218d0a0bf695914fffd87044a0bec
|
|
4
|
+
data.tar.gz: 2053942ef02267580a1de02f57f7bfdf1109b18c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 856c1961e647dd32cc02d8b80c5a335cea517210bf2fc774c78efb9f6e678814ebb788122cd1350f2215ee955454e52c2ccd7eaae21d2b60dd77dd3c3f330700
|
|
7
|
+
data.tar.gz: c2e3ea86d40c1034d3f5f8eb93e162bc5f7859946b2f27588b1e24c35070d4fe1fccf8240ed1130edbbf5d23f5b4817e783fcb7c06b1ad497b173fc12dd163db
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
V�\�ת���0�f�H�ʎ�u�W�lDy`��C�=��֛�Z���$�=�5��l�Kx,������K�͙���y%N@��:�g��zV�"��X(Ơ��1�O �z<��=ɲ\�>�{E*�g�%��S����2�3*�3�1V{��9�1�Z���-��}���7\���|�-N�E�����9r��8�H^io�
|
|
2
|
+
��@����� "���,�5�h�m%��or������yS�6��b}�"g��6<R
|
|
@@ -22,7 +22,8 @@ class HumbleRPiPluginDhtSensor
|
|
|
22
22
|
temperature_threshold: 1,
|
|
23
23
|
humidity_threshold: 2,
|
|
24
24
|
interval: 3,
|
|
25
|
-
msg_format: "%s/dht11_sensor: temperature: %s humidity: %s"
|
|
25
|
+
msg_format: "%s/dht11_sensor: temperature: %s humidity: %s",
|
|
26
|
+
pushrate: 60
|
|
26
27
|
}.merge settings
|
|
27
28
|
|
|
28
29
|
@version = h[:version]
|
|
@@ -30,6 +31,7 @@ class HumbleRPiPluginDhtSensor
|
|
|
30
31
|
@humidity_threshold = h[:humidity_threshold]
|
|
31
32
|
@interval = h[:interval]
|
|
32
33
|
@msg_format = h[:msg_format]
|
|
34
|
+
@pushrate = h[:pushrate]
|
|
33
35
|
|
|
34
36
|
@notifier = variables[:notifier]
|
|
35
37
|
@device_id = variables[:device_id] || 'pi'
|
|
@@ -42,14 +44,17 @@ class HumbleRPiPluginDhtSensor
|
|
|
42
44
|
|
|
43
45
|
val = DhtSensor.read(@pin, @version)
|
|
44
46
|
push val
|
|
47
|
+
last_push = Time.now
|
|
45
48
|
|
|
46
49
|
loop do
|
|
47
50
|
|
|
48
|
-
|
|
51
|
+
val = DhtSensor.read(@pin, @version)
|
|
49
52
|
|
|
50
|
-
if
|
|
51
|
-
|
|
53
|
+
if last_push + @pushrate < Time.now and \
|
|
54
|
+
((@old_tval - val.temperature).abs >= @temperature_threshold or \
|
|
55
|
+
(@old_hval - val.humidity).abs >= @humidity_threshold) then
|
|
52
56
|
push val
|
|
57
|
+
last_push = Time.now
|
|
53
58
|
end
|
|
54
59
|
|
|
55
60
|
sleep @interval
|
|
@@ -70,4 +75,4 @@ class HumbleRPiPluginDhtSensor
|
|
|
70
75
|
|
|
71
76
|
end
|
|
72
77
|
|
|
73
|
-
end
|
|
78
|
+
end
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|