home_assistant-ble 1.2.0.pre.alpha.pre.23 → 1.2.0.pre.alpha.pre.24

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/lib/home_assistant/ble.rb +8 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c28a9c7e42348d70fb55bda4695c304e4cb5d6ad
4
- data.tar.gz: 2ee9ce33e643386f09200fd9432e52b68f8c3d58
3
+ metadata.gz: b357ccfc00ccd0a27f2706fb84f31ff190fee03b
4
+ data.tar.gz: 9112df5e3a80bf8269d41004a335b90e26cf9ad2
5
5
  SHA512:
6
- metadata.gz: 6bd8dfb509881c05d89293711bb84cdc56f32ee33640f55876ccf27fdfe81d822e33746af03f37c91a0ebe5726c811afe0c20489425907333596a45c24a5d903
7
- data.tar.gz: f11c6afa067109402bb1091f997091bd34da031bff274c6ffaeacade3ba49905d6efaf2acc3f5e08e64b9d29bbdc12083dfde8536269e040ffc8c53108abed5e
6
+ metadata.gz: 36d40755c8427404aa587e072506cf43fe61ee25960bf7bd8de042a49be4cecb497c95421fd12b4c8f6df88e7520375d992898dee3860022ec207a482304c781
7
+ data.tar.gz: a77d74a7e9728d4aa214fbf5d54312c000ba81babbf0a4b17a6fe9df29c696bef198885a60916dab548d9b7c0e0ea4a6572203639272daabda2e233b11b6055f
@@ -52,6 +52,7 @@ module HomeAssistant
52
52
  loop do
53
53
  detect_devices
54
54
  clean_devices
55
+ release_adapter
55
56
  debug "Will sleep #{interval}s before relisting devices"
56
57
  sleep interval
57
58
  end
@@ -124,10 +125,17 @@ module HomeAssistant
124
125
  BLE::Adapter.new(iface).tap do |a|
125
126
  debug 'Activating discovery'
126
127
  a.start_discovery
128
+ debug 'Sleeping a bit to discover devices'
129
+ sleep 20
130
+ a.stop_discovery
127
131
  end
128
132
  end
129
133
  end
130
134
 
135
+ def release_adapter
136
+ @adapter = nil
137
+ end
138
+
131
139
  def ensure_rights!
132
140
  BLE::Adapter.list.first
133
141
  rescue DBus::Error => e
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: home_assistant-ble
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0.pre.alpha.pre.23
4
+ version: 1.2.0.pre.alpha.pre.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grégoire Seux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-26 00:00:00.000000000 Z
11
+ date: 2017-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler