Browse files

Align with rel.645 OpenZWave Driver.h enums

  • Loading branch information...
1 parent 7e5d6f7 commit 5d4b2f4ac91c5865534fa36ecd585eece9916258 @ekarak committed Mar 9, 2013
Showing with 180 additions and 239 deletions.
  1. +2 −2 ansible_callback.rb
  2. +22 −6 ansible_value.rb
  3. +8 −0 config.rb
  4. +1 −1 devices/ansible_dimmer.rb
  5. +0 −2 devices/ansible_switch.rb
  6. +0 −76 knx/knx_eistypes.rb
  7. +1 −0 test1.rb
  8. +1 −1 test2.rb
  9. +7 −7 test3.rb
  10. +3 −1 transceiver.rb
  11. +20 −9 zwave/types/valuetype_list.rb
  12. +114 −133 zwave/zwave_transceiver.rb
  13. +1 −1 zwave/zwave_value.rb
View
4 ansible_callback.rb
@@ -108,7 +108,7 @@ def fire_callback(event, target=nil, *args)
if defined?(@callbacks) and @callbacks.is_a?Hash then
[@callbacks[event], @callbacks[:default]].each { |hsh|
if hsh.is_a?Hash then
- puts "#{self}.fire_callback, event #{event}: about to fire: #{hsh.inspect}"
+ #puts "#{self}.fire_callback, event #{event}: about to fire: #{hsh.inspect}"
if target.nil? then
# add all targets to the list of procs to call
# including the default
@@ -124,7 +124,7 @@ def fire_callback(event, target=nil, *args)
# time to fire callbacks
cb_procs.flatten.compact.each { |cb_proc|
raise "ooops, found a #{cb_proc.class} stored as a callback!" unless cb_proc.is_a?Proc
- puts "firing #{event} callback, args: #{args.inspect}"
+ # puts "firing #{event} callback, args: #{args.inspect}"
cb_proc.call(self, event.to_s, *args)
}
end
View
28 ansible_value.rb
@@ -33,24 +33,40 @@ module AnsibleValue
include AnsibleCallback
+ # every AnsibleValue has a previous and a current value. Note that previous_value
+ # is nil until the second call to set()
attr_reader :previous_value, :current_value
+
+ # timestamp of last value update
attr_reader :last_update
+
+ # generic hash of flags
attr_reader :flags
- # return true if a value's instance variable (whose symbol is iv_symbol) matches a filter value (as a regexp)
- # e.g. value.matches?(:name => /elias/, :telephone => /210/)
- def matches?(hash)
- raise "#{self.class}: AnsibleValue.match? single argument must be a hash.." unless hash.is_a?Hash
+ # returns true if a value's internal state matches using a hashmap, where each
+ # - key: is a symbol (the name of an instance variable)
+ # - value: is a Regexp (instance varriable matches regexp)
+ # OR an Array (instance var is contained in array)
+ # OR a Range (instance var in included in the range)
+ # OR a plain object (instance var == object)
+ # e.g. value.matches?(:name => /son$/, :age => 21..30)
+ # return true if a value's :name ends in son (Ericsson) and is aged between 21 and 30
+ # it is used to implement a simplistic O(n) AnsibleValue searching facility
+ def matches?(filtermap)
+ raise "#{self.class}: AnsibleValue.match? single argument must be a Hash!" unless filtermap.is_a?Hash
result = true
- hash.each { |iv_symbol, filter|
- raise "#{self.class}: AnsibleValue.match?(hash)'s keys must be Symbols.." unless iv_symbol.is_a?Symbol
+ filtermap.each { |iv_symbol, filter|
+ raise "#{self.class}: Keys of AnsibleValue.match?(filtermap) must be Symbols!" unless iv_symbol.is_a?Symbol
if respond_to?(iv_symbol) and (val = instance_eval(iv_symbol.to_s)) then
#puts "match.val(#{iv_symbol}) == #{val.inspect}" if $DEBUG
result = result & case filter
# if the filter is a regular expression, use it to match the instance value
when Regexp then filter.match(val.to_s)
# if the filter is an array, use set intersection
when Array then (filter & val).length > 0
+ # if the filter is a Range, use range inclusion
+ when Range then (filter === val)
+ # otherwise use plain equality
else filter == val
end
else
View
8 config.rb
@@ -92,3 +92,11 @@ module OpenZWave
$:.push("/home/ekarak/ozw/Thrift4OZW/gen-rb")
end
+
+# from http://snippets.dzone.com/posts/show/2785
+module Kernel
+private
+ def this_method_name
+ caller[0] =~ /`([^']*)'/ and $1
+ end
+end
View
2 devices/ansible_dimmer.rb
@@ -22,7 +22,7 @@
http://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License
=end
-require 'ansible_device'
+require 'devices/ansible_switch'
module Ansible
View
2 devices/ansible_switch.rb
@@ -22,8 +22,6 @@
http://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License
=end
-require 'ansible_device'
-
module Ansible
#
View
76 knx/knx_eistypes.rb
@@ -1,76 +0,0 @@
-=begin
-Project Ansible - An extensible home automation scripting framework
-----------------------------------------------------
-Copyright (c) 2011 Elias Karakoulakis <elias.karakoulakis@gmail.com>
-
-SOFTWARE NOTICE AND LICENSE
-
-Project Ansible is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License,
-or (at your option) any later version.
-
-Project Ansible is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Project Ansible. If not, see <http://www.gnu.org/licenses/>.
-
-for more information on the LGPL, see:
-http://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License
-=end
-
-module Ansible
-
- module KNX
-
- # the skeleton class for the datatypes in use by the KNX standard
- class EISType
-
- # singleton hash holding all known EISType instances
- # key => primary_type (integer 1 to 255)
- # value => hash of secondary types (secondary_type => instance)
- # -- NOTE: the contained secondary types hash can be set
- # to report a default instance that holds a generic EISType.
- # Thus we define datatypes with great granularity.
- @@alltypes = {}
-
- # method for getting all known EIS types as a flat array
- def EISType.all
- return @@alltypes.values.collect{ |st| st.values + st.default}.flatten.compact
- end
-
- # initializes a new datatype
- def initialize(primary_type, secondary_type)
- puts "Initializing new EISType pri=#{primary_type} sec=#{secondary_type}"
- @primary_type , @secondary_type = primary_type , secondary_type
- @@alltypes[primary_type] = {} unless @@alltypes[primary_type].is_a? Hash
- # store ourselves in the big hash of types
- if secondary_type.nil? then
- puts "==> Redeclaring default EISType for primary=#{primary_type}" if @@alltypes[primary_type]
- @@alltypes[primary_type].default = self
- else
- @@alltypes[primary_type][secondary_type] = self
- end
- end
-
- # return a human-readable description for this EISType
- def to_s
- return 'EIS' + @primary_type.to_s + (@secondary_type.nil? ? "" : ".#{@secondary_type}")
- end
-
- # takes a KNX value and abstracts its data
- # usage: eis1.abstractor {|value| value.to_s }
-
- def abstractor=(&block)
- # in its most basic form, abstract_value just returns the value
- return(value.get()
- end
-
- end # class
-
- end #module KNX
-
-end #module Ansible
View
1 test1.rb
@@ -39,6 +39,7 @@
sleep(3)
S = AnsibleValue[:_nodeId => 2, :_genre => 1]
+AD = AnsibleValue[:_nodeId => 3, :_genre => 1]
D = AnsibleValue[:_nodeId => 5, :_genre => 1]
K = AnsibleValue[:_nodeId => 6, :_genre => 1]
View
2 test2.rb
@@ -31,7 +31,7 @@
require 'config'
-KNX = Ansible::KNX::KNX_Transceiver.new(Ansible::KNX_URL)
+KNX = Ansible::KNX::KNX_Transceiver.new(Ansible::KNX::KNX_URL)
# monitor all KNX activity
KNX.add_callback(:onKNXtelegram) { | sender, cb, frame |
if frame.dst_addr < 4048 then
View
14 test3.rb
@@ -64,7 +64,7 @@
:_nodeId => 2,
:_genre => OpenZWave::RemoteValueGenre::ValueGenre_Basic][0]
ZWDimmer = AnsibleValue[
- :_nodeId => 5,
+ :_nodeId => 3,
:_genre => OpenZWave::RemoteValueGenre::ValueGenre_User,
:_commandClassId => 38, #SWITCH_MULTILEVEL
:_valueIndex => 0][0]
@@ -85,12 +85,12 @@
# map my ACT HomePro Lamp module to KNX
DIMMER = Dimmer.new(
- :master_control => ZWDimmer,
- :switch => KNXValue.new("1.001", "1/0/40"),
- :switch_status => KNXValue.new("1.001", "1/0/41"),
- :dimming => KNXValue.new('5.001', "1/0/42"),
- :dimming_status => KNXValue.new('5.001', "1/0/43"),
- :scene => KNXValue.new('18.001', "1/0/44")
+ :master_control => ZWDimmer, # ZWave node 3
+ :switch => KNXValue.new("1.001", "1/0/30"),
+ :switch_status => KNXValue.new("1.001", "1/0/31"),
+ :dimming => KNXValue.new('5.001', "1/0/32"),
+ :dimming_status => KNXValue.new('5.001', "1/0/33"),
+ :scene => KNXValue.new('18.001', "1/0/34")
)
# map my garden lights to ZWave
View
4 transceiver.rb
@@ -57,7 +57,9 @@ def run
def stop()
@thread.stop
end
-
+
+ attr_reader :all_devices
+
end
end
View
29 zwave/types/valuetype_list.rb
@@ -32,30 +32,41 @@ module ValueType_List
# define type-specific OZW::Manager API calls
def read_operation
- raise 'FIXME'
- return :GetValueListItems
+ init_value_list
+ return :GetValueListSelection_Int32
end
def write_operation
- raise 'FIXME'
+ init_value_list
return :SetValueListSelection
end
#
def as_canonical_value()
- puts 'TODO'
+ init_value_list
+ selection_index = manager_send(:GetValueListSelection, self)
+ selection = @value_list[selection_index]
+ raise "Selection index #{selection} out of bounds" unless selection.is_a?String
end
- #
+ # convert string to value list index
def to_protocol_value(new_val)
- result = nil
- if [TrueClass, FalseClass].include?(new_val.class)
- result = new_val ? 1 : 0
- end
+ init_value_list
+ raise "ValueType_List: string '#{new_val}' not found in ValueListItems!"
+ return @value_list.index(new_val)
end
# return a human-readable representation of a ZWave frame
def explain
+ init_value_list
+ @value_list[@current_value]
+ end
+
+ # initialize value list array
+ def init_value_list
+ unless @value_list.nil?
+ @value_list = manager_send(:GetValueListItems, self)
+ end
end
end
View
247 zwave/zwave_transceiver.rb
@@ -58,30 +58,24 @@ def initialize(stompURL, thriftURL)
@ValueMonitors = {}
@ValueMonitorMutex = Mutex.new
+ # handler for both connection_[closed|died]
+ @connFailureHandler = Proc.new { |client, con|
+ @stomp_ok = false
+ puts "STOMP connection died!! sleeping for 3 seconds and then retrying..."
+ puts "stack trace: \n\t"<< caller.join("\t\n")
+ sleep(3)
+ @stompserver.connect
+ }
end
- # initialize connection to STOMP server
def init_stomp
unless @stomp_ok
begin
+ # initialize connection to STOMP server
#puts "init_stomp\n-------------\n\t" + caller.join("\n\t") + "\n"
@stompserver = OnStomp::Client.new(@stompURL)
- @stompserver.on_connection_died { |client, con|
- @stomp_ok = false
- puts "STOMP connection died!! sleeping for 3 seconds and then retrying..."
- puts "stack trace: \n\t"<< caller.join("\t\n")
- sleep(3)
- @stompserver.connect
- }
- #
- @stompserver.on_connection_closed { |client, con|
- @stomp_ok = false
- puts "STOMP connection closed!! sleeping for 10 seconds and then retrying..."
- puts "stack trace: \n\t"<< caller.join("\t\n")
- sleep(10)
- @stompserver.connect
- }
- #
+ @stompserver.on_connection_died &@connFailureHandler
+ @stompserver.on_connection_closed &@connFailureHandler
@stompserver.on_connection_established { |client, con|
puts "STOMP: Connected to broker using protocol version #{con.version}"
@stomp_ok = true
@@ -107,8 +101,8 @@ def stomp
# initialize connection to THRIFT server
def init_thrift()
unless @thrift_ok
- # connect to Thrift server for OpenZWave
- begin
+ # connect to Thrift server for OpenZWave
+ begin
if md = ThriftURL_RE.match(@thriftURL) then
host = md[1]
port = md[2].nil?? 9090: md[2].to_i
@@ -117,35 +111,46 @@ def init_thrift()
@thrift_protocol = Thrift::BinaryProtocol.new(@thrift_transport)
@thrift_transport.open()
@manager = ::OpenZWave::RemoteManager::Client.new(@thrift_protocol)
+ @thrift_ok = true
+ # the heartbeat thread sends a controller node query every 2 seconds
+ @thrift_heartbeat = thriftHeartbeat()
# fetch all known ValueID's from the server
@manager.SendAllValues
- @thrift_ok = true
- @thrift_heartbeat = Thread.new{
- puts "Thrift: New heartbeat thread, #{Thread.current}"
- # aargh, ugly heartbeat
- while (@thrift_ok) do
- sleep(1)
- #puts 'ping...'
- manager_send(:GetControllerNodeId, HomeID)
- end
- puts "Thrift: heartbeat thread exiting, #{Thread.current}"
- }
else
raise "Thrift URL invalid"
end
- #rescue Thrift::TransportException => e
rescue Exception => e
@thrift_ok = false
puts "#{e}"
end
end
- return @manager
+ return @manager
end
+ def thriftHeartbeat
+ return Thread.new {
+ puts "Thrift: New heartbeat thread, #{Thread.current}"
+ while (@thrift_ok) do
+ sleep(2)
+ @thriftMutex.synchronize {
+ begin
+ #print 'ping...'
+ @manager.ping()
+ #puts 'pong!'
+ rescue Exception => e
+ puts e
+ @thrift_ok = false
+ end
+ }
+ end
+ puts "Thrift: heartbeat thread exiting, #{Thread.current}"
+ }
+ end
+
# get handle to OpenZWave::RemoteManager
def manager
# TODO: add caller watch here, (check for unsynchronized access)
- @thrift_ok ? @manager : init_thrift()
+ @thrift_ok ? @manager : init_thrift()
end
# the preferred method to access OpenZWave::Manager methods
@@ -157,15 +162,15 @@ def manager_send(meth, *args)
begin
result = manager.method(meth).call(*args)
rescue Thrift::TransportException => e
+ # mark connection as not OK so as to reconnect at next call
@thrift_ok = false
puts "Thrift transport exception, in method #{meth.inspect}"
- puts "--------------------------, callers=\n\t\t" + caller[0..2].join("\n\t\t")
+ puts "--------------------------, callers=\n\t\t" + caller[0..4].join("\n\t\t")
sleep(1)
retry
rescue Exception => e
- @thrift_ok = false
puts "OpenZWave exception: #{e}, in method #{meth.inspect}"
- puts "--------------------, callers=\n\t\t" + caller[0..2].join("\n\t\t")
+ puts "--------------------, callers=\n\t\t" + caller[0..4].join("\n\t\t")
end
}
return(result)
@@ -188,11 +193,11 @@ def run
valueID = msg.headers["ValueID"]
# sync current HomeID
h = homeID.to_i(16)
- unless Ansible::ZWave.const_defined?(:HomeID) then
- if h > 0 then
- puts "------ SETTING HOME ID: #{homeID}"
- Ansible::ZWave.const_set("HomeID", h)
- end
+ if Ansible::ZWave.const_defined?(:HomeID) then
+ raise "HomeID changed from 0x#{Ansible::ZWave::HomeID.to_s(16)} to #{homeID}" unless h == Ansible::ZWave::HomeID
+ elsif h > 0 then
+ puts "------ SETTING HOME ID: #{homeID}"
+ Ansible::ZWave.const_set("HomeID", h)
end
# get or create ValueID object
value = Ansible::ZWave::ValueID.get_or_create(homeID, valueID)
@@ -217,7 +222,9 @@ def run
end
# controller state change notification mechanism
if ctrl_state = msg.headers["ControllerState"] then
- controller_state(ctrl_state.to_i(16))
+ if idx = ctrl_state.to_i then
+ puts OpenZWave::ControllerStates[idx].join(': ')
+ end
end
rescue Exception => e
puts "ZWaveTransceiver::decode_monitor() exception: #{e}"
@@ -238,160 +245,122 @@ def run
# a value has been added to the Z-Wave network
def notification_ValueAdded(nodeId, byte, value)
- #@@Values[homeID].push(value)
+ puts "Value #{value} ADDED"
+ #@@Values[homeID].push(value)
end
- # a value has been removed from the Z-Wave network
+
+ # A node value has been removed from OpenZWave's list.
+ # This only occurs when a node is removed.
def notification_ValueRemoved(nodeId, byte, value)
- # A node value has been removed from OpenZWave's list. This only occurs when a node is removed.
- #@@Values[homeID].delete(value)
+ puts "Value #{value} REMOVED"
+ #@@Values[homeID].delete(value)
end
# A node value has been updated from the Z-Wave network.
- def notification_ValueChanged(nodeId, byte, value)
- # OpenZWave peculiarity: we got a ValueChanged event, but the value
- # reported by OpenZWave is unchanged. Thus we need to poll the
- # device using :RequestNodeDynamic, wait for NodeQueriesComplete
- # then re-get the value
- #trigger_value_monitor(value)
- #
- # as of r471 ValueChanged behaves correctly
- AnsibleValue[:_nodeId => nodeId, :_gerne => 1].each { |v|
- v.get
- }
+ def notification_ValueChanged(nodeId, byte, value)
+ # node monitor phase 2:
+ if value.get
+ @ValueMonitorMutex.synchronize do
+ sleep(2)
+ AnsibleValue[:_nodeId => nodeId].each { |val|
+ val.get()
+ }
+ # all values now should be fresh
+ @ValueMonitors[nodeId] = false
+ fire_callback(:onMonitorStop)
+ puts "==> trigger change monitor ENDED<=="
+ end
end
# A node value has been refreshed from the Z-Wave network.
- def notification_ValueRefreshed(nodeId, byte, value)
+ def notification_ValueRefreshed(nodeId, byte, value); end
#value.get unless value.nil?
- end
# The associations for the node have changed. The application
# should rebuild any group information it holds about the node.
- def notification_Group(nodeId, byte, value)
- puts 'TODO'
- end
+ def notification_Group(nodeId, byte, value); end
# A new node has been found (not already stored in zwcfg*.xml file)
- def notification_NodeNew(nodeId, byte, value)
- puts 'TODO'
- end
+ def notification_NodeNew(nodeId, byte, value); end
# A new node has been added to OpenZWave's list. This may be due
# to a device being added to the Z-Wave network, or because the
# application is initializing itself.
- def notification_NodeAdded(nodeId, byte, value)
- puts 'TODO'
- end
+ def notification_NodeAdded(nodeId, byte, value); end
# A node has been removed from OpenZWave's list. This may be due
# to a device being removed from the Z-Wave network, or because
# the application is closing.
- def notification_NodeRemoved(nodeId, byte, value)
- puts 'TODO'
- end
+ def notification_NodeRemoved(nodeId, byte, value); end
# Basic node information has been receievd, such as whether
# the node is a listening device, a routing device and its
# baud rate and basic, generic and specific types. It is
# after this notification that you can call Manager::GetNodeType
# to obtain a label containing the device description. */
- def notification_NodeProtocolInfo(nodeId, byte, value)
- puts 'TODO'
- end
+ def notification_NodeProtocolInfo(nodeId, byte, value); end
# One of the node names has changed (name, manufacturer, product).
- def notification_NodeNaming(nodeId, byte, value)
- puts 'TODO'
- end
+ def notification_NodeNaming(nodeId, byte, value); end
# A node has triggered an event. This is commonly caused when a node
# sends a Basic_Set command to the controller. The event value is
# stored in the notification.
def notification_NodeEvent(nodeId, byte, value)
- puts 'TODO'
+ # OpenZWave peculiarity: we eventually got a ValueChanged event, but the value
+ # reported by OpenZWave is unchanged. Thus we need to poll the
+ # device using :RequestNodeDynamic, wait for NodeQueriesComplete
+ # then re-get the value
+ trigger_node_monitor(nodeId)
end
# Polling of a node has been successfully turned off by a call
# to Manager::DisablePoll
- def notification_PollingDisabled(nodeId, byte, value)
- puts 'TODO'
- end
+ def notification_PollingDisabled(nodeId, byte, value); end
# Polling of a node has been successfully turned on by a call
# to Manager::EnablePoll
- def notification_PollingEnabled(nodeId, byte, value)
- puts 'TODO'
- end
+ def notification_PollingEnabled(nodeId, byte, value); end
# A driver for a PC Z-Wave controller has been added and is ready
# to use. The notification will contain the controller's Home ID,
# which is needed to call most of the Manager methods.
- def notification_DriverReady(nodeId, byte, value)
- puts 'TODO'
- end
+ def notification_DriverReady(nodeId, byte, value); end
# Driver failed to load */
- def notification_DriverFailed(nodeId, byte, value)
- puts 'TODO'
- end
+ def notification_DriverFailed(nodeId, byte, value); end
# All nodes and values for this driver have been removed.
# This is sent instead of potentially hundreds of individual node
# and value notifications.
- def notification_DriverReset(nodeId, byte, value)
- puts 'TODO'
- end
+ def notification_DriverReset(nodeId, byte, value); end
# The last message that was sent is now complete.
- def notification_MsgComplete(nodeId, byte, value)
- puts 'TODO'
- end
+ def notification_MsgComplete(nodeId, byte, value); end
# The queries on a node that are essential to its operation have
# been completed. The node can now handle incoming messages.
- def notification_EssentialNodeQueriesComplete(nodeId, byte, value)
+ def notification_EssentialNodeQueriesComplete(nodeId, byte, value); end
#OpenZWave::RefreshedNodes[nodeId] = true
- end
# All the initialisation queries on a node have been completed.
- def notification_NodeQueriesComplete(nodeId, byte, value)
- # node monitor phase 2:
-=begin
- @ValueMonitorMutex.synchronize do
- sleep(2)
- AnsibleValue[:_nodeId => nodeId].each { |val|
- val.get()
- }
- # all values now should be fresh
- @ValueMonitors[nodeId] = false
- fire_callback(:onMonitorStop)
- puts "==> trigger change monitor ENDED<=="
- end
-=end
- end
+ def notification_NodeQueriesComplete(nodeId, byte, value); end
# All awake nodes have been queried, so client application can
# expected complete data for these nodes.
- def notification_AwakeNodesQueried(nodeId, byte, value)
- puts 'TODO'
- end
+ def notification_AwakeNodesQueried(nodeId, byte, value); end
# All nodes have been queried, so client application can
# expect complete data.
- def notification_AllNodesQueried(nodeId, byte, value) #
- puts 'TODO'
- end
+ def notification_AllNodesQueried(nodeId, byte, value); end
# ------------------------------
# CONTROLLER STATE NOTIFICATIONS
# ------------------------------
- # handle controller state notifications
- def controller_state(idx)
- puts OpenZWave::ControllerStates[idx].join(': ')
- end
=begin
+
ControllerCommand_RemoveFailedNode (id=7)
irb(main):024:0> ZWT.manager.BeginControllerCommand(HomeID, 7, false, 3, 0)
=> true
@@ -404,13 +373,21 @@ def controller_state(idx)
=end
# TODO: remove all AnsibleValues upon completion of
-
-=begin
-DEPRECATED since OZW rev.477
+
+
# Zwave value notification system only informs us about a _manual_
# operation of a ZWave node using a ValueChanged notification.
# We need to monitor that node in order to get the actual device status.
- def trigger_value_monitor(nodeId)
+ # Sequence of events:
+=begin
+ notification_NodeEvent (n:3) (b:255) ()
+ (calls trigger_value_monitor)
+ notification_ValueChanged (n:3) (b:0) (ZWaveValue[n:3 g:1 cc:38 i:1 vi:0 t:1]==94(Fixnum))
+ notification_NodeQueriesComplete (n:3) (b:0) ()
+
+=end
+
+ def trigger_node_monitor(nodeId)
@ValueMonitorMutex.synchronize do
# define a node monitor proc then spawn a new thread to run it
unless @ValueMonitors[nodeId] then
@@ -424,12 +401,16 @@ def trigger_value_monitor(nodeId)
# then declare the handler to run upon NodeQueriesComplete notification
@ValueMonitors[nodeId] = true
# node monitor phase 2: see notification_NodeQueriesComplete
- end # unless
- end # do
- end
-=end
+ end # unless
+
+ end # do
+
+ end #def
+
end #class
- end
+ end # module ZWave
+
+end # module Ansible
-end # module Ansible
+end
View
2 zwave/zwave_value.rb
@@ -138,7 +138,7 @@ def read_value()
return(false) unless respond_to? :read_operation
result = @@transceiver.manager_send(read_operation, self)
if result and result.retval then
- puts "#{self}.read_value() result == #{result.o_value}, Refreshed=#{RefreshedNodes[@_nodeId]}"
+ #puts "#{self}.read_value() result == #{result.o_value}, Refreshed=#{RefreshedNodes[@_nodeId]}"
update(result.o_value)
return(true)
else

0 comments on commit 5d4b2f4

Please sign in to comment.