pigpiod 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/exe/pigpio_mqtt_bridge +12 -3
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7402311d7d55303c25209cbe6dd119955681714fe86e8ee830a0931575ddc79e
4
- data.tar.gz: 9a1805587185f5724683d4f36801bb534ea8b5cd256e08f288161c6a59dace40
3
+ metadata.gz: 1e285c4b929eb167ab7dc2d4091a077664a9399e03aae3ce40a9d99b25f14d15
4
+ data.tar.gz: c621f8bd3306b0a44edb8411a6bec748de2311b75dd4a35a41465fe6695edf1c
5
5
  SHA512:
6
- metadata.gz: 608f85c221dc559a57c9273febf63c9c583049caa28a7e1fd506c9bb9c48bc0320cff7ce8694e8b58ec8cf8a2f019fc29671b6545cb766f3c446b0faee1b234f
7
- data.tar.gz: 01e51a27bd50621c79380383735fb5a954379c552d94d1a636242be1830ef16ccc956888ca2ee4e454b3e61e03693a12a6e9785ef93bf2cefff29efbf556d397
6
+ metadata.gz: 39076afc1200e35892b97e09535ed4b082d5b771c3711df13187cca7743c09cfebda35ae56cad5b5b67177b424f753d3864aec7453515f63ac060064b332ef0a
7
+ data.tar.gz: ccbe0468ebe05e6dc71af03f5626a408a174a0abd14e30974672f887b46eda55366f9ac2ade59811739dcba3334444c546e136b4ebe8e31e889514fa42ee18e0
@@ -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
- 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]
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.1
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: 2021-12-15 00:00:00.000000000 Z
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.2.5
128
+ rubygems_version: 3.3.7
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Publish pigpiod access to MQTT