openplacos 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/openplacos/libclient.rb +16 -5
- data/lib/openplacos.rb +2 -2
- data/openplacos.gemspec +2 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/lib/openplacos/libclient.rb
CHANGED
@@ -16,14 +16,13 @@
|
|
16
16
|
|
17
17
|
module Openplacos
|
18
18
|
class Client # client for openplacos server
|
19
|
-
attr_accessor :config, :objects, :service, :sensors, :actuators, :rooms
|
19
|
+
attr_accessor :config, :objects, :service, :sensors, :actuators, :rooms, :reguls
|
20
20
|
|
21
21
|
def initialize
|
22
|
-
|
23
22
|
if(ENV['DEBUG_OPOS'] ) ## Stand for debug
|
24
|
-
@bus = DBus::
|
23
|
+
@bus = DBus::SessionBus.instance
|
25
24
|
else
|
26
|
-
@bus =
|
25
|
+
@bus = DBus::SystemBus.instance
|
27
26
|
end
|
28
27
|
if @bus.service("org.openplacos.server").exists?
|
29
28
|
@service = @bus.service("org.openplacos.server")
|
@@ -36,6 +35,7 @@ module Openplacos
|
|
36
35
|
#get sensors and actuators
|
37
36
|
@sensors = get_sensors
|
38
37
|
@actuators = get_actuators
|
38
|
+
@reguls = get_reguls
|
39
39
|
else
|
40
40
|
puts "Can't find OpenplacOS server"
|
41
41
|
Process.exit 1
|
@@ -47,7 +47,7 @@ module Openplacos
|
|
47
47
|
def get_rooms(nod)
|
48
48
|
room = Array.new
|
49
49
|
nod.each_pair{ |key,value|
|
50
|
-
if not(key=="Debug" or key=="server") #ignore debug objects
|
50
|
+
if not(key=="Debug" or key=="server" or key=="plugins") #ignore debug objects
|
51
51
|
if value.object.nil?
|
52
52
|
room.push(key)
|
53
53
|
end
|
@@ -100,5 +100,16 @@ module Openplacos
|
|
100
100
|
}
|
101
101
|
actuators
|
102
102
|
end
|
103
|
+
|
104
|
+
def get_reguls
|
105
|
+
reguls = Hash.new
|
106
|
+
@objects.each_pair{ |key, value|
|
107
|
+
if value.has_iface?('org.openplacos.server.regul')
|
108
|
+
reguls[key] = value['org.openplacos.server.regul']
|
109
|
+
end
|
110
|
+
}
|
111
|
+
reguls
|
112
|
+
end
|
113
|
+
|
103
114
|
end
|
104
115
|
end
|
data/lib/openplacos.rb
CHANGED
@@ -13,9 +13,9 @@
|
|
13
13
|
# You should have received a copy of the GNU General Public License
|
14
14
|
# along with Openplacos. If not, see <http://www.gnu.org/licenses/>.
|
15
15
|
#
|
16
|
-
require 'dbus'
|
17
16
|
ENV["DBUS_THREADED_ACCESS"] = "1" #activate threaded dbus
|
18
|
-
|
17
|
+
require 'rubygems'
|
18
|
+
require 'dbus'
|
19
19
|
require 'openplacos/libplugin'
|
20
20
|
require 'openplacos/libclient'
|
21
21
|
require 'openplacos/libdriver'
|
data/openplacos.gemspec
CHANGED
@@ -7,8 +7,8 @@ GEMSPEC = Gem::Specification.new do |s|
|
|
7
7
|
# s.rubyforge_project = nil
|
8
8
|
s.summary = "Openplacos libraries : Libclient, LibPlugin, LibDriver"
|
9
9
|
s.description = <<-EOF
|
10
|
-
Openplacos Gem is a set of libraries for openplacos software
|
11
|
-
|
10
|
+
Openplacos Gem is a set of libraries for openplacos software.
|
11
|
+
These libraries allow an easier coding of openplacos clients, plugins or drivers in ruby.
|
12
12
|
EOF
|
13
13
|
s.version = File.read("VERSION").strip
|
14
14
|
s.author = "Openplacos Team"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openplacos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Openplacos Team
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
version: 0.6.0
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
|
-
description: " Openplacos Gem is a set of libraries for openplacos software
|
37
|
+
description: " Openplacos Gem is a set of libraries for openplacos software.\n These libraries allow an easier coding of openplacos clients, plugins or drivers in ruby.\n"
|
38
38
|
email: openplacos-general@lists.sourceforge.net
|
39
39
|
executables: []
|
40
40
|
|