openhab-scripting 4.43.1 → 4.43.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: deaecd8879b238c5372c733482c69ef38703231f42a8869954d692ebd3c4fc7b
4
- data.tar.gz: d11b35e9b654531f1c248992cb1cd2eca1e675dd37898ca28ce16760a1531c07
3
+ metadata.gz: a7ffe3540ffb1e1538b60f38b9943e5ed72bded20d313d0702884921d30b5843
4
+ data.tar.gz: bd72fa1f8a18b9a5fa5b06f57e50a5943ecd4252d091307cd21f4f50d0c50805
5
5
  SHA512:
6
- metadata.gz: 3052e39904c2548942c1018b592ca3370b3c15bdd1dc92685ee647f9854bcc406b886f1168b75954adab98884a45c9a92a7eb039a13056be5f4a99772111e425
7
- data.tar.gz: 752cd312e184091663ea4c47506787fdd6ea9e56b1a794593c093b413784340bbb97c95956e716762757b355a6089e45cb96dbe2d61b6787f98641bbde557e75
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) # rubocop: disable Style/GlobalVars
89
+ item = $ir.get(name)
92
90
  ItemProxy.new(item) unless item.nil?
93
91
  end
94
92
  end
@@ -22,7 +22,7 @@ module OpenHAB
22
22
  # Lookup item from item registry
23
23
  #
24
24
  def __getobj__
25
- $ir.get(@item_name) # rubocop:disable Style/GlobalVars
25
+ $ir.get(@item_name)
26
26
  end
27
27
  end
28
28
  end
@@ -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
@@ -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 }
@@ -46,7 +46,7 @@ module OpenHAB
46
46
 
47
47
  # explicit conversion to array
48
48
  def to_a
49
- $ir.items.grep(org.openhab.core.items.GroupItem) # rubocop:disable Style/GlobalVars
49
+ $ir.items.grep(org.openhab.core.items.GroupItem)
50
50
  end
51
51
  end
52
52
  end
@@ -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? # rubocop: disable Style/GlobalVars
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 # rubocop:disable Style/GlobalVars
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'
@@ -12,7 +12,7 @@ module OpenHAB
12
12
  #
13
13
  # MonkeyPatching ScriptThingActions
14
14
  #
15
- class << $actions # rubocop:disable Style/GlobalVars
15
+ class << $actions
16
16
  field_reader :THING_ACTIONS_MAP
17
17
 
18
18
  #
@@ -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
- added_rule.actions.first.id = 'script'
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) # rubocop:disable Style/GlobalVars
151
+ while $rules.get(rule.uid)
152
152
  duplicate_index += 1
153
153
  rule.uid = "#{base_uid} (#{duplicate_index})"
154
154
  end
@@ -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) # rubocop: disable Style/GlobalVars
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) } # rubocop: disable Style/GlobalVars
122
+ $things.getAll.map { |thing| Thing.new(thing) }
123
123
  end
124
124
 
125
125
  private
@@ -5,5 +5,5 @@
5
5
  #
6
6
  module OpenHAB
7
7
  # @return [String] Version of OpenHAB helper libraries
8
- VERSION = '4.43.1'
8
+ VERSION = '4.43.2'
9
9
  end
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.1
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-18 00:00:00.000000000 Z
11
+ date: 2022-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler