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.
- checksums.yaml +4 -4
- data/lib/home_assistant/ble.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b357ccfc00ccd0a27f2706fb84f31ff190fee03b
|
4
|
+
data.tar.gz: 9112df5e3a80bf8269d41004a335b90e26cf9ad2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36d40755c8427404aa587e072506cf43fe61ee25960bf7bd8de042a49be4cecb497c95421fd12b4c8f6df88e7520375d992898dee3860022ec207a482304c781
|
7
|
+
data.tar.gz: a77d74a7e9728d4aa214fbf5d54312c000ba81babbf0a4b17a6fe9df29c696bef198885a60916dab548d9b7c0e0ea4a6572203639272daabda2e233b11b6055f
|
data/lib/home_assistant/ble.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2017-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|