pigpiod 0.0.2 → 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 +6 -1
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 755c246694e16bb88402c4674f45785fe4af5294f4e92c4624da7d7eee001068
4
- data.tar.gz: 38f615dce7d46425a149e270b8a8d68e60396a0281ea736c05346b049eb73309
3
+ metadata.gz: 1e285c4b929eb167ab7dc2d4091a077664a9399e03aae3ce40a9d99b25f14d15
4
+ data.tar.gz: c621f8bd3306b0a44edb8411a6bec748de2311b75dd4a35a41465fe6695edf1c
5
5
  SHA512:
6
- metadata.gz: d19665b2effaa41cee2290e48940960a9940129df70993a9dd0005f30bf66186d438d3c4c6b4fafe03bfcc144e88ae4a8f57f3fbc0217c298389b5ff0dfa65a8
7
- data.tar.gz: e220dc9d415eb2291ec4aaa985fffbc55aa43cc7d3ea8fe2dcdb7a558383f64ae65993e0561b9c9c33652f77a8576e6babd0ec28bd2be529492bf38034d3d6fb
6
+ metadata.gz: 39076afc1200e35892b97e09535ed4b082d5b771c3711df13187cca7743c09cfebda35ae56cad5b5b67177b424f753d3864aec7453515f63ac060064b332ef0a
7
+ data.tar.gz: ccbe0468ebe05e6dc71af03f5626a408a174a0abd14e30974672f887b46eda55366f9ac2ade59811739dcba3334444c546e136b4ebe8e31e889514fa42ee18e0
@@ -34,7 +34,12 @@ 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"]
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
38
43
  gpio.pull_up_down = gpio_config["pull_up_down"].to_sym if gpio_config["pull_up_down"]
39
44
  gpio.invert_logic = gpio_config["invert_logic"] if gpio_config["invert_logic"]
40
45
  end
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.2
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