home_assistant-ble 1.4.0.pre.alpha.pre.44 → 1.4.0.pre.alpha.pre.48
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/home_assistant-ble +17 -2
- 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: e70a505266edab18f2a422f4427c9838e07913eb
|
4
|
+
data.tar.gz: dde03a39be711f158c0cfae7fbd970f99e7ba7b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 352414b6e5899233cd254f8de3d295d55eba44815c710bd38ac125e7157efc42e716ec814c04dd0adb9e523e6abccc74242e9c096d9db00c84ada8dbeba3ce84
|
7
|
+
data.tar.gz: 61a644bd7d1301b550a39b71eb21285cacfb104632faeea154bc7a278d51c3aa2f79707942c29cfffea9ac76c1001f08845d71e207542c54c4454fc34245d37b
|
data/bin/home_assistant-ble
CHANGED
@@ -9,6 +9,21 @@ require 'yaml'
|
|
9
9
|
$stdout.sync = true
|
10
10
|
$stderr.sync = true
|
11
11
|
|
12
|
+
def shut_down
|
13
|
+
@detector.clean_all_devices
|
14
|
+
$stdout.puts 'Quitting'
|
15
|
+
end
|
16
|
+
|
17
|
+
Signal.trap('INT') do
|
18
|
+
shut_down
|
19
|
+
exit
|
20
|
+
end
|
21
|
+
|
22
|
+
Signal.trap('TERM') do
|
23
|
+
shut_down
|
24
|
+
exit
|
25
|
+
end
|
26
|
+
|
12
27
|
config_file = ARGV.shift
|
13
28
|
config = {}
|
14
29
|
if config_file
|
@@ -17,6 +32,6 @@ else
|
|
17
32
|
$stderr.puts 'No configuration file specified, will use all default values'
|
18
33
|
end
|
19
34
|
|
20
|
-
detector = HomeAssistant::Ble::Detector.new(config)
|
35
|
+
@detector = HomeAssistant::Ble::Detector.new(config)
|
21
36
|
|
22
|
-
detector.run
|
37
|
+
@detector.run
|
data/lib/home_assistant/ble.rb
CHANGED
@@ -71,6 +71,14 @@ module HomeAssistant
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
+
def clean_all_devices
|
75
|
+
known_devices.keys.each do |name|
|
76
|
+
known_devices.delete(name).tap do
|
77
|
+
home_assistant_devices[name] && update_home_assistant(home_assistant_devices[name], :not_home)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
74
82
|
private
|
75
83
|
|
76
84
|
def log(message)
|
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.4.0.pre.alpha.pre.
|
4
|
+
version: 1.4.0.pre.alpha.pre.48
|
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-04-
|
11
|
+
date: 2017-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|