openhab-scripting 4.43.1 → 4.43.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.
- checksums.yaml +4 -4
- data/lib/openhab/core/entity_lookup.rb +1 -3
- data/lib/openhab/core/item_proxy.rb +1 -1
- data/lib/openhab/core/osgi.rb +0 -2
- data/lib/openhab/core/services.rb +0 -2
- data/lib/openhab/dsl/actions.rb +0 -4
- data/lib/openhab/dsl/group.rb +1 -1
- data/lib/openhab/dsl/items/item_registry.rb +2 -2
- data/lib/openhab/dsl/items/timed_command.rb +0 -2
- data/lib/openhab/dsl/monkey_patch/actions/script_thing_actions.rb +1 -1
- data/lib/openhab/dsl/rules/rule.rb +2 -2
- data/lib/openhab/dsl/things.rb +2 -2
- data/lib/openhab/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7ffe3540ffb1e1538b60f38b9943e5ed72bded20d313d0702884921d30b5843
|
4
|
+
data.tar.gz: bd72fa1f8a18b9a5fa5b06f57e50a5943ecd4252d091307cd21f4f50d0c50805
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d980ee1aee7685e711b322baf8307f83e6bff963a59a8dcb00b012e66c6c0b104d3369e39337180554ae24d057ffb2d374654eb3f4ea9a5acf08d78237b2f210
|
7
|
+
data.tar.gz: 776d0d64562bb90461b6c87282311e4db548ead4eb8f5823b0ccd042880552f6b5b838b0fd9289adc481ccb988ee3212be583668df2b75e3cd2c03b1103c94a2
|
@@ -73,9 +73,7 @@ module OpenHAB
|
|
73
73
|
return if name.count('_') < 3
|
74
74
|
|
75
75
|
name = name.tr('_', ':')
|
76
|
-
# rubocop: disable Style/GlobalVars
|
77
76
|
$things.get(Java::OrgOpenhabCoreThing::ThingUID.new(name))
|
78
|
-
# rubocop: enable Style/GlobalVars
|
79
77
|
end
|
80
78
|
|
81
79
|
#
|
@@ -88,7 +86,7 @@ module OpenHAB
|
|
88
86
|
def self.lookup_item(name)
|
89
87
|
logger.trace("Looking up item(#{name})")
|
90
88
|
name = name.to_s if name.is_a? Symbol
|
91
|
-
item = $ir.get(name)
|
89
|
+
item = $ir.get(name)
|
92
90
|
ItemProxy.new(item) unless item.nil?
|
93
91
|
end
|
94
92
|
end
|
data/lib/openhab/core/osgi.rb
CHANGED
@@ -50,9 +50,7 @@ module OpenHAB
|
|
50
50
|
|
51
51
|
# Get the OSGI Bundle for ScriptExtension Class
|
52
52
|
def self.bundle
|
53
|
-
# rubocop: disable Style/GlobalVars
|
54
53
|
@bundle ||= FrameworkUtil.getBundle($scriptExtension.class)
|
55
|
-
# rubocop: enable Style/GlobalVars
|
56
54
|
end
|
57
55
|
private_class_method :bundle
|
58
56
|
end
|
@@ -11,7 +11,6 @@ module OpenHAB
|
|
11
11
|
|
12
12
|
# Get the OpenHAB automation manager
|
13
13
|
# @return [AutomationManager] OpenHAB Automation manager
|
14
|
-
# rubocop:disable Style/GlobalVars
|
15
14
|
def self.automation_manager
|
16
15
|
$scriptExtension.get('automationManager')
|
17
16
|
end
|
@@ -21,6 +20,5 @@ module OpenHAB
|
|
21
20
|
def self.rule_registry
|
22
21
|
$scriptExtension.get('ruleRegistry')
|
23
22
|
end
|
24
|
-
# rubocop:enable Style/GlobalVars
|
25
23
|
end
|
26
24
|
end
|
data/lib/openhab/dsl/actions.rb
CHANGED
@@ -29,9 +29,7 @@ module OpenHAB
|
|
29
29
|
# @return [Object] OpenHAB action
|
30
30
|
#
|
31
31
|
def actions(scope, thing_uid)
|
32
|
-
# rubocop: disable Style/GlobalVars
|
33
32
|
$actions.get(scope, thing_uid)
|
34
|
-
# rubocop: enable Style/GlobalVars
|
35
33
|
end
|
36
34
|
|
37
35
|
#
|
@@ -43,9 +41,7 @@ module OpenHAB
|
|
43
41
|
#
|
44
42
|
def actions_for_thing(thing_uid)
|
45
43
|
thing_uid = thing_uid.to_s
|
46
|
-
# rubocop: disable Style/GlobalVars
|
47
44
|
action_keys = $actions.action_keys
|
48
|
-
# rubocop: enable Style/GlobalVars
|
49
45
|
logger.trace("Registered actions: '#{action_keys}' for thing '#{thing_uid}'")
|
50
46
|
action_keys.map { |action_key| action_key.split('-', 2) }
|
51
47
|
.select { |action_pair| action_pair.last == thing_uid }
|
data/lib/openhab/dsl/group.rb
CHANGED
@@ -39,14 +39,14 @@ module OpenHAB
|
|
39
39
|
# @param name [String] Item name to check
|
40
40
|
# @return [Boolean] true if the item exists, false otherwise
|
41
41
|
def include?(name)
|
42
|
-
!$ir.getItems(name).empty?
|
42
|
+
!$ir.getItems(name).empty?
|
43
43
|
end
|
44
44
|
alias key? include?
|
45
45
|
|
46
46
|
# Explicit conversion to array
|
47
47
|
# @return [Array]
|
48
48
|
def to_a
|
49
|
-
$ir.items.to_a
|
49
|
+
$ir.items.to_a
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
@@ -177,10 +177,8 @@ module OpenHAB
|
|
177
177
|
logger.trace "Canceling implicit timer #{@timed_command_details.timer} for "\
|
178
178
|
"#{@timed_command_details.item.id} because received event #{inputs}"
|
179
179
|
@timed_command_details.timer.cancel
|
180
|
-
# rubocop: disable Style/GlobalVars
|
181
180
|
# Disabled due to OpenHAB design
|
182
181
|
$scriptExtension.get('ruleRegistry').remove(@timed_command_details.rule_uid)
|
183
|
-
# rubocop: enable Style/GlobalVars
|
184
182
|
TimedCommand.timed_commands.delete(@timed_command_details.item)
|
185
183
|
if @block
|
186
184
|
logger.trace 'Executing user supplied block on timed command cancelation'
|
@@ -89,7 +89,7 @@ module OpenHAB
|
|
89
89
|
rule = AutomationRule.new(config: config)
|
90
90
|
Rule.script_rules << rule
|
91
91
|
added_rule = add_rule(rule)
|
92
|
-
|
92
|
+
# add config so that MainUI can show the script
|
93
93
|
added_rule.actions.first.configuration.put('type', 'application/x-ruby')
|
94
94
|
added_rule.actions.first.configuration.put('script', script)
|
95
95
|
|
@@ -148,7 +148,7 @@ module OpenHAB
|
|
148
148
|
def add_rule(rule)
|
149
149
|
base_uid = rule.uid
|
150
150
|
duplicate_index = 1
|
151
|
-
while $rules.get(rule.uid)
|
151
|
+
while $rules.get(rule.uid)
|
152
152
|
duplicate_index += 1
|
153
153
|
rule.uid = "#{base_uid} (#{duplicate_index})"
|
154
154
|
end
|
data/lib/openhab/dsl/things.rb
CHANGED
@@ -108,7 +108,7 @@ module OpenHAB
|
|
108
108
|
# @return Thing specified by name/UID or nil if name/UID does not exist in thing registry
|
109
109
|
def [](uid)
|
110
110
|
uid = generate_thing_uid(uid) unless uid.is_a?(org.openhab.core.thing.ThingUID)
|
111
|
-
thing = $things.get(uid)
|
111
|
+
thing = $things.get(uid)
|
112
112
|
return unless thing
|
113
113
|
|
114
114
|
logger.trace("Retrieved Thing(#{thing}) from registry for uid: #{uid}")
|
@@ -119,7 +119,7 @@ module OpenHAB
|
|
119
119
|
|
120
120
|
# explicit conversion to array
|
121
121
|
def to_a
|
122
|
-
$things.getAll.map { |thing| Thing.new(thing) }
|
122
|
+
$things.getAll.map { |thing| Thing.new(thing) }
|
123
123
|
end
|
124
124
|
|
125
125
|
private
|
data/lib/openhab/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openhab-scripting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.43.
|
4
|
+
version: 4.43.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian O'Connell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|