rsmp 0.6.5 → 0.7.3

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: 7ffe9f097053c9814ad119cbd6a01192cd20c02d3ca1fffa6269dbdf534f419b
4
- data.tar.gz: 9848398d419a76f16fa8eb1f527d4c6b055b17886a5ee689b7607c891103d5a1
3
+ metadata.gz: c9f08828abc4896fcc6a40da66ed96db50f1c7ba8d2b819ae7f7771930920bd4
4
+ data.tar.gz: 618100d9e2bf8ace347274a791740b094cf690be3e00e12d35f491e7a717b58e
5
5
  SHA512:
6
- metadata.gz: d974b915cbc32bee428cc7f39a1e26134c6db34f72590ad9bd67400ad71ce831037a82341601369aa6582c1e4b5ecf8d4e6f8c3249a4375716bc877ca1cc7cec
7
- data.tar.gz: 301eb51aecb05c57fc3395f3a06df33846e24fdd863db2ff65e81e9fc1b7c23c4e6b40e508b15a3ec0c92e87595ce78317773cfca6e13ec72ca9609d037cb1f1
6
+ metadata.gz: fe9ce63eae79b1145e0bce329a5c2ed723075293d1811402d65349bc368f9246bfbe4823dddb33d3dead0e74bf113937f8aac1b1c39680af81cd313637c05d71
7
+ data.tar.gz: e2451b14a8a9889de965a1e67b5e42e0dcfb6d28cbeb1d9bbfd962b324c8087502a93b1095edaf80fdae1c0721c38912d78d48154a8d359b2fd3846bd69063f7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rsmp (0.6.5)
4
+ rsmp (0.7.3)
5
5
  async (~> 1.29.1)
6
6
  async-io (~> 1.32.1)
7
7
  colorize (~> 0.8.1)
@@ -15,5 +15,3 @@ log:
15
15
  level: false
16
16
  debug: true
17
17
  json: true
18
- acknowledgements: false
19
- watchdogs: false
data/config/tlc.yaml CHANGED
@@ -48,5 +48,3 @@ log:
48
48
  level: false
49
49
  debug: true
50
50
  json: true
51
- acknowledgements: false
52
- watchdogs: false
@@ -85,7 +85,7 @@ module RSMP
85
85
  raise RepeatedAlarmError.new("no changes from previous alarm #{previous.m_id_short}")
86
86
  end
87
87
  if Time.parse(message.attribute('aTs')) < Time.parse(previous.attribute('aTs'))
88
- raise RepeatedAlarmError.new("timestamp is earlier than previous alarm #{previous.m_id_short}")
88
+ raise TimestampError.new("timestamp is earlier than previous alarm #{previous.m_id_short}")
89
89
  end
90
90
  end
91
91
  ensure
data/lib/rsmp/logger.rb CHANGED
@@ -14,6 +14,7 @@ module RSMP
14
14
  'hide_ip_and_port' => false,
15
15
  'acknowledgements' => false,
16
16
  'watchdogs' => false,
17
+ 'alarms' => true,
17
18
  'json'=>false,
18
19
  'tabs'=>'-',
19
20
 
@@ -44,6 +45,15 @@ module RSMP
44
45
  'id'=>4,
45
46
  }
46
47
 
48
+ @ignorable = {
49
+ 'versions' => ['Version'],
50
+ 'statuses' => ['StatusRequest','StatusSubscribe','StatusUnsubscribe','StatusResponse','StatusUpdate'],
51
+ 'commands' => ['CommandRequest','CommandResponse'],
52
+ 'watchdogs' => 'Watchdog',
53
+ 'alarms' => ['Alarm'],
54
+ 'aggregated_status' => ['AggregatedStatus','AggregatedStatusRequest']
55
+ }
56
+
47
57
  if settings
48
58
  @settings = defaults.merge settings
49
59
  else
@@ -95,11 +105,14 @@ module RSMP
95
105
 
96
106
  if item[:message]
97
107
  type = item[:message].type
98
- ack = type == "MessageAck" || type == "MessageNotAck"
99
- if @settings["watchdogs"] == false
100
- return false if type == "Watchdog"
101
- if ack
102
- return false if item[:message].original && item[:message].original.type == "Watchdog"
108
+ ack = (type == "MessageAck" || type == "MessageNotAck")
109
+ @ignorable.each_pair do |key,types|
110
+ ignore = [types].flatten
111
+ if @settings[key] == false
112
+ return false if ignore.include?(type)
113
+ if ack
114
+ return false if item[:message].original && ignore.include?(item[:message].original.type)
115
+ end
103
116
  end
104
117
  end
105
118
  return false if ack && @settings["acknowledgements"] == false &&
@@ -68,7 +68,7 @@ module RSMP
68
68
  else
69
69
  super message
70
70
  end
71
- rescue RSMP::RepeatedAlarmError, RSMP::RepeatedStatusError => e
71
+ rescue RSMP::RepeatedAlarmError, RSMP::RepeatedStatusError, TimestampError => e
72
72
  str = "Rejected #{message.type} message,"
73
73
  dont_acknowledge message, str, "#{e}"
74
74
  notify_error e.exception("#{str}#{e.message} #{message.json}")
@@ -19,7 +19,12 @@ module RSMP
19
19
  @signal_plans = {}
20
20
  return unless signal_plans
21
21
  signal_plans.each_pair do |id,settings|
22
- @signal_plans[id.to_i] = SignalPlan.new(nr: id.to_i, states:settings['states'],dynamic_bands:settings['dynamic_bands'])
22
+ states = nil
23
+ bands = nil
24
+ states = settings['states'] if settings
25
+ dynamic_bands = settings['dynamic_bands'] if settings
26
+
27
+ @signal_plans[id.to_i] = SignalPlan.new(nr: id.to_i, states:states,dynamic_bands:dynamic_bands)
23
28
  end
24
29
  end
25
30
 
data/lib/rsmp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RSMP
2
- VERSION = "0.6.5"
2
+ VERSION = "0.7.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsmp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Tin