openhab-scripting 4.42.1 → 4.42.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: 5e41958655d441761618cb21164c7954bcb05c037023a080d2a70a741637d951
4
- data.tar.gz: ee4252bafef8e2a430f98c80bc3277e5c45ef9cd0c06b645f48da848031f0abf
3
+ metadata.gz: '08c9201c21983751d80e9c2e4df683c39cef20763a5321fd2f8fdcd355cdb6c5'
4
+ data.tar.gz: f0b2c25837d2396e70d11ba503920ff443992bd9cf007b18a2003f6857a17929
5
5
  SHA512:
6
- metadata.gz: c1dcd8ab59e1732eb76acd9c707d4dbd18dcae94d3fd6236d6c53362958b7fd0c977ef001c109f147df596321a99ee7640aceb25f92530f7cb8f59bd7733de9f
7
- data.tar.gz: 70d92d8df318f317c42843cf8eaae67b33c9cdb24f119074f7e59e117ec29f53f1594df05e8fd35059a666a600845375048f991c9cc15b35772fb34b35d83a4f
6
+ metadata.gz: bff012a5dc7caf0e06fb9d0f3aede99afc9ad067004390ae606d392c34fe3662b017395fa3c200e759c2023e4801fb775ee097a29f0b90554f721d8fbbf9cf47
7
+ data.tar.gz: b862f6f69383d86e1a230d2c702c440c0b6dd465ed22ec16ad03a47166bd319004a8f82147eed2da514b301523f99c917c9d93de56f6ea7b9907ab5713f9d61d
@@ -37,7 +37,7 @@ module OpenHAB
37
37
  end
38
38
 
39
39
  # if we're NULL or UNDEF, implement special logic
40
- return nil_comparison unless state?
40
+ return nil_comparison(other) unless state?
41
41
 
42
42
  # delegate to how the state compares to the other object
43
43
  state <=> other
@@ -45,9 +45,10 @@ module OpenHAB
45
45
 
46
46
  # Special logic for NULL/UNDEF state comparison
47
47
  # @!visibility private
48
- def nil_comparison
48
+ def nil_comparison(other)
49
49
  # if comparing to nil, consider ourselves equal
50
50
  return 0 if other.nil?
51
+
51
52
  # if the other object is an Item, only consider equal if we're
52
53
  # in the same _kind_ of UnDefType state
53
54
  return raw_state == other.raw_state if other.is_a?(GenericItem) && !other.state?
@@ -8,7 +8,6 @@ require_relative 'guard'
8
8
  require_relative 'rule_triggers'
9
9
  require 'openhab/core/entity_lookup'
10
10
  require 'openhab/dsl/between'
11
- require 'openhab/dsl/dsl'
12
11
  require 'openhab/dsl/timers'
13
12
 
14
13
  module OpenHAB
@@ -20,9 +20,6 @@ module OpenHAB
20
20
  class Proc
21
21
  include OpenHAB::Log
22
22
 
23
- # Proc that doesn't check any fields
24
- ANY = Proc.new.freeze
25
-
26
23
  #
27
24
  # Converts supplied ranges to procs that check range
28
25
  # @param [Array] ranges objects to convert to range proc if they are ranges
@@ -83,6 +80,9 @@ module OpenHAB
83
80
  @command = command
84
81
  end
85
82
 
83
+ # Proc that doesn't check any fields
84
+ ANY = Proc.new.freeze # this needs to be defined _after_ initialize so its instance variables are set
85
+
86
86
  #
87
87
  # Process rule
88
88
  # @param [Hash] inputs inputs from trigger
@@ -5,5 +5,5 @@
5
5
  #
6
6
  module OpenHAB
7
7
  # @return [String] Version of OpenHAB helper libraries
8
- VERSION = '4.42.1'
8
+ VERSION = '4.42.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.42.1
4
+ version: 4.42.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-06-20 00:00:00.000000000 Z
11
+ date: 2022-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler