Module: Ansible::ZWave::ValueType_Button

Defined in:
lib/ansible/zwave/openzwave/types/valuetype_button.rb

Overview

button value type for OpenZWave

Instance Method Summary collapse

Instance Method Details

#as_canonical_valueObject



42
43
44
45
# File 'lib/ansible/zwave/openzwave/types/valuetype_button.rb', line 42

def as_canonical_value()
    puts 'TODO:: zwave_button: as_canonical'
    return (current_value > 0)
end

#explainObject

return a human-readable representation of a ZWave frame



57
58
# File 'lib/ansible/zwave/openzwave/types/valuetype_button.rb', line 57

def explain
end

#read_operationObject

define type-specific OZW::Manager API calls



33
34
35
# File 'lib/ansible/zwave/openzwave/types/valuetype_button.rb', line 33

def read_operation 
    return nil # FIXME 
end

#to_protocol_value(new_val) ⇒ Object



48
49
50
51
52
53
54
# File 'lib/ansible/zwave/openzwave/types/valuetype_button.rb', line 48

def to_protocol_value(new_val)
    puts 'TODO:: zwave_button: to_protocol'
    result = nil
    if [TrueClass, FalseClass].include?(new_val.class)
        result = new_val ? 1 : 0
    end
end

#write_operationObject



37
38
39
# File 'lib/ansible/zwave/openzwave/types/valuetype_button.rb', line 37

def write_operation 
    return :PressButton # FIXME: also: ReleaseButton
end