pigpiod 0.0.1 → 0.0.3
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 +12 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e285c4b929eb167ab7dc2d4091a077664a9399e03aae3ce40a9d99b25f14d15
|
4
|
+
data.tar.gz: c621f8bd3306b0a44edb8411a6bec748de2311b75dd4a35a41465fe6695edf1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39076afc1200e35892b97e09535ed4b082d5b771c3711df13187cca7743c09cfebda35ae56cad5b5b67177b424f753d3864aec7453515f63ac060064b332ef0a
|
7
|
+
data.tar.gz: ccbe0468ebe05e6dc71af03f5626a408a174a0abd14e30974672f887b46eda55366f9ac2ade59811739dcba3334444c546e136b4ebe8e31e889514fa42ee18e0
|
data/exe/pigpio_mqtt_bridge
CHANGED
@@ -34,9 +34,14 @@ 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
|
-
|
38
|
-
|
39
|
-
|
37
|
+
desired_mode = gpio_config["mode"]&.to_sym
|
38
|
+
if desired_mode && desired_mode != gpio.mode
|
39
|
+
gpio.mode = desired_mode
|
40
|
+
# reset to to high if first changing to output
|
41
|
+
gpio.level = true if desired_mode == :output
|
42
|
+
end
|
43
|
+
gpio.pull_up_down = gpio_config["pull_up_down"].to_sym if gpio_config["pull_up_down"]
|
44
|
+
gpio.invert_logic = gpio_config["invert_logic"] if gpio_config["invert_logic"]
|
40
45
|
end
|
41
46
|
|
42
47
|
homie = MQTT::Homie::Device.new(device_id, "PiGPIO", mqtt: ARGV[0])
|
@@ -56,6 +61,10 @@ PiGPIO.instance.gpios.each do |gpio|
|
|
56
61
|
format: %w[up down off]) do |value|
|
57
62
|
gpio.pull_up_down = value.to_sym
|
58
63
|
end
|
64
|
+
node.property("invert-logic", "Invert Logic", :boolean, gpio.invert_logic) do |value|
|
65
|
+
gpio.invert_logic = value
|
66
|
+
node["level"] = gpio.level
|
67
|
+
end
|
59
68
|
end
|
60
69
|
end
|
61
70
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pigpiod
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cody Cutrer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mqtt-homeassistant
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
127
|
requirements: []
|
128
|
-
rubygems_version: 3.
|
128
|
+
rubygems_version: 3.3.7
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: Publish pigpiod access to MQTT
|