openhab-scripting 5.6.0 → 5.7.0
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.
- checksums.yaml +4 -4
- data/lib/openhab/core/actions/audio.rb +5 -2
- data/lib/openhab/core/items/registry.rb +1 -1
- data/lib/openhab/core/items/semantics.rb +12 -19
- data/lib/openhab/core/provider.rb +1 -1
- data/lib/openhab/core/sitemaps/provider.rb +132 -0
- data/lib/openhab/core/things/proxy.rb +2 -1
- data/lib/openhab/core/types/date_time_type.rb +2 -1
- data/lib/openhab/core/types/open_closed_type.rb +2 -1
- data/lib/openhab/core/types/quantity_type.rb +45 -35
- data/lib/openhab/core/types/string_type.rb +1 -1
- data/lib/openhab/core/types/up_down_type.rb +2 -1
- data/lib/openhab/core/value_cache.rb +5 -4
- data/lib/openhab/core_ext/java/duration.rb +2 -1
- data/lib/openhab/core_ext/java/local_time.rb +8 -6
- data/lib/openhab/core_ext/java/month_day.rb +2 -1
- data/lib/openhab/core_ext/java/period.rb +1 -1
- data/lib/openhab/core_ext/ruby/numeric.rb +1 -0
- data/lib/openhab/dsl/items/builder.rb +3 -1
- data/lib/openhab/dsl/rules/builder.rb +54 -23
- data/lib/openhab/dsl/rules/triggers/conditions/generic.rb +1 -1
- data/lib/openhab/dsl/rules/triggers/cron/cron.rb +33 -14
- data/lib/openhab/dsl/sitemaps/builder.rb +942 -0
- data/lib/openhab/dsl/things/builder.rb +4 -2
- data/lib/openhab/dsl/version.rb +1 -1
- data/lib/openhab/dsl.rb +5 -0
- data/lib/openhab/osgi.rb +1 -1
- data/lib/openhab/rspec/karaf.rb +5 -2
- data/lib/openhab/rspec/openhab/core/actions.rb +0 -3
- metadata +11 -23
@@ -187,7 +187,8 @@ module OpenHAB
|
|
187
187
|
configuration = Core::Configuration.new(config)
|
188
188
|
if thing_type
|
189
189
|
self.class.thing_factory_helper.apply_default_configuration(
|
190
|
-
configuration,
|
190
|
+
configuration,
|
191
|
+
thing_type,
|
191
192
|
self.class.config_description_registry
|
192
193
|
)
|
193
194
|
end
|
@@ -200,7 +201,8 @@ module OpenHAB
|
|
200
201
|
|
201
202
|
if thing_type
|
202
203
|
# can't use with_channels, or it will wipe out custom channels from above
|
203
|
-
self.class.thing_factory_helper.create_channels(thing_type,
|
204
|
+
self.class.thing_factory_helper.create_channels(thing_type,
|
205
|
+
uid,
|
204
206
|
self.class.config_description_registry).each do |channel|
|
205
207
|
builder.with_channel(channel)
|
206
208
|
end
|
data/lib/openhab/dsl/version.rb
CHANGED
data/lib/openhab/dsl.rb
CHANGED
data/lib/openhab/osgi.rb
CHANGED
@@ -46,7 +46,7 @@ module OpenHAB
|
|
46
46
|
|
47
47
|
bundle = org.osgi.framework.FrameworkUtil.get_bundle(interfaces.first.java_class)
|
48
48
|
bundle.bundle_context.register_service(
|
49
|
-
interfaces.map
|
49
|
+
interfaces.map { |i| i.java_class.name }.to_java(java.lang.String),
|
50
50
|
instance,
|
51
51
|
java.util.Hashtable.new(properties)
|
52
52
|
)
|
data/lib/openhab/rspec/karaf.rb
CHANGED
@@ -154,7 +154,9 @@ module OpenHAB
|
|
154
154
|
klass.field_accessor :classLoader, :activatorManager
|
155
155
|
klass.field_writer :framework
|
156
156
|
klass.field_reader :LOG
|
157
|
-
org.apache.karaf.main.ConfigProperties.field_reader :props,
|
157
|
+
org.apache.karaf.main.ConfigProperties.field_reader :props,
|
158
|
+
:defaultBundleStartlevel,
|
159
|
+
:karafEtc,
|
158
160
|
:defaultStartLevel
|
159
161
|
klass.class_eval do
|
160
162
|
def send_private(method_name, *args)
|
@@ -472,7 +474,8 @@ module OpenHAB
|
|
472
474
|
thf = Mocks::ThingHandlerFactory.instance
|
473
475
|
bundle = org.osgi.framework.FrameworkUtil.get_bundle(org.openhab.core.thing.Thing.java_class)
|
474
476
|
Mocks::BundleResolver.instance.register_class(thf.class, bundle)
|
475
|
-
bundle.bundle_context.register_service(org.openhab.core.thing.binding.ThingHandlerFactory.java_class,
|
477
|
+
bundle.bundle_context.register_service(org.openhab.core.thing.binding.ThingHandlerFactory.java_class,
|
478
|
+
thf,
|
476
479
|
nil)
|
477
480
|
end
|
478
481
|
end
|
@@ -3,7 +3,6 @@
|
|
3
3
|
module OpenHAB
|
4
4
|
module Core
|
5
5
|
module Actions
|
6
|
-
# rubocop:disable Lint/UnusedMethodArgument
|
7
6
|
# redefine these to do nothing so that rules won't fail
|
8
7
|
|
9
8
|
module_function
|
@@ -31,8 +30,6 @@ module OpenHAB
|
|
31
30
|
end
|
32
31
|
end
|
33
32
|
end
|
34
|
-
|
35
|
-
# rubocop:enable Lint/UnusedMethodArgument
|
36
33
|
end
|
37
34
|
end
|
38
35
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openhab-scripting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian O'Connell
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-09-
|
13
|
+
date: 2023-09-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -214,14 +214,14 @@ dependencies:
|
|
214
214
|
requirements:
|
215
215
|
- - "~>"
|
216
216
|
- !ruby/object:Gem::Version
|
217
|
-
version: 1.13
|
217
|
+
version: '1.13'
|
218
218
|
type: :development
|
219
219
|
prerelease: false
|
220
220
|
version_requirements: !ruby/object:Gem::Requirement
|
221
221
|
requirements:
|
222
222
|
- - "~>"
|
223
223
|
- !ruby/object:Gem::Version
|
224
|
-
version: 1.13
|
224
|
+
version: '1.13'
|
225
225
|
- !ruby/object:Gem::Dependency
|
226
226
|
name: persistent_httparty
|
227
227
|
requirement: !ruby/object:Gem::Requirement
|
@@ -279,33 +279,19 @@ dependencies:
|
|
279
279
|
- !ruby/object:Gem::Version
|
280
280
|
version: '3.11'
|
281
281
|
- !ruby/object:Gem::Dependency
|
282
|
-
name: rubocop
|
282
|
+
name: rubocop-inst
|
283
283
|
requirement: !ruby/object:Gem::Requirement
|
284
284
|
requirements:
|
285
|
-
- - "
|
285
|
+
- - ">="
|
286
286
|
- !ruby/object:Gem::Version
|
287
|
-
version: '
|
287
|
+
version: '0'
|
288
288
|
type: :development
|
289
289
|
prerelease: false
|
290
290
|
version_requirements: !ruby/object:Gem::Requirement
|
291
291
|
requirements:
|
292
|
-
- - "
|
293
|
-
- !ruby/object:Gem::Version
|
294
|
-
version: '1.8'
|
295
|
-
- !ruby/object:Gem::Dependency
|
296
|
-
name: rubocop-performance
|
297
|
-
requirement: !ruby/object:Gem::Requirement
|
298
|
-
requirements:
|
299
|
-
- - "~>"
|
300
|
-
- !ruby/object:Gem::Version
|
301
|
-
version: '1.11'
|
302
|
-
type: :development
|
303
|
-
prerelease: false
|
304
|
-
version_requirements: !ruby/object:Gem::Requirement
|
305
|
-
requirements:
|
306
|
-
- - "~>"
|
292
|
+
- - ">="
|
307
293
|
- !ruby/object:Gem::Version
|
308
|
-
version: '
|
294
|
+
version: '0'
|
309
295
|
- !ruby/object:Gem::Dependency
|
310
296
|
name: rubocop-rake
|
311
297
|
requirement: !ruby/object:Gem::Requirement
|
@@ -456,6 +442,7 @@ files:
|
|
456
442
|
- lib/openhab/core/rules/rule.rb
|
457
443
|
- lib/openhab/core/rules/tagged_array.rb
|
458
444
|
- lib/openhab/core/script_handling.rb
|
445
|
+
- lib/openhab/core/sitemaps/provider.rb
|
459
446
|
- lib/openhab/core/things.rb
|
460
447
|
- lib/openhab/core/things/channel.rb
|
461
448
|
- lib/openhab/core/things/channel_uid.rb
|
@@ -544,6 +531,7 @@ files:
|
|
544
531
|
- lib/openhab/dsl/rules/triggers/trigger.rb
|
545
532
|
- lib/openhab/dsl/rules/triggers/updated.rb
|
546
533
|
- lib/openhab/dsl/rules/triggers/watch/watch_handler.rb
|
534
|
+
- lib/openhab/dsl/sitemaps/builder.rb
|
547
535
|
- lib/openhab/dsl/things/builder.rb
|
548
536
|
- lib/openhab/dsl/thread_local.rb
|
549
537
|
- lib/openhab/dsl/timer_manager.rb
|