pigpiod 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/pigpio_mqtt_bridge +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 755c246694e16bb88402c4674f45785fe4af5294f4e92c4624da7d7eee001068
|
4
|
+
data.tar.gz: 38f615dce7d46425a149e270b8a8d68e60396a0281ea736c05346b049eb73309
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d19665b2effaa41cee2290e48940960a9940129df70993a9dd0005f30bf66186d438d3c4c6b4fafe03bfcc144e88ae4a8f57f3fbc0217c298389b5ff0dfa65a8
|
7
|
+
data.tar.gz: e220dc9d415eb2291ec4aaa985fffbc55aa43cc7d3ea8fe2dcdb7a558383f64ae65993e0561b9c9c33652f77a8576e6babd0ec28bd2be529492bf38034d3d6fb
|
data/exe/pigpio_mqtt_bridge
CHANGED
@@ -34,9 +34,9 @@ config.each do |pin, gpio_config|
|
|
34
34
|
pin = pin.to_i
|
35
35
|
raise "Unrecognized gpio" unless (gpio = PiGPIO.instance.gpios[pin])
|
36
36
|
|
37
|
-
gpio.mode = gpio_config[
|
38
|
-
gpio.pull_up_down = gpio_config[
|
39
|
-
gpio.invert_logic = gpio_config[
|
37
|
+
gpio.mode = gpio_config["mode"].to_sym if gpio_config["mode"]
|
38
|
+
gpio.pull_up_down = gpio_config["pull_up_down"].to_sym if gpio_config["pull_up_down"]
|
39
|
+
gpio.invert_logic = gpio_config["invert_logic"] if gpio_config["invert_logic"]
|
40
40
|
end
|
41
41
|
|
42
42
|
homie = MQTT::Homie::Device.new(device_id, "PiGPIO", mqtt: ARGV[0])
|
@@ -56,6 +56,10 @@ PiGPIO.instance.gpios.each do |gpio|
|
|
56
56
|
format: %w[up down off]) do |value|
|
57
57
|
gpio.pull_up_down = value.to_sym
|
58
58
|
end
|
59
|
+
node.property("invert-logic", "Invert Logic", :boolean, gpio.invert_logic) do |value|
|
60
|
+
gpio.invert_logic = value
|
61
|
+
node["level"] = gpio.level
|
62
|
+
end
|
59
63
|
end
|
60
64
|
end
|
61
65
|
|