Module: Ansible::ZWave::ValueType_Decimal

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

Overview

Decimal value type for OpenZWave: special form for string representation of floating point values in order to avoid rounding errors

Instance Method Summary collapse

Instance Method Details

#as_canonical_valueObject



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

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

#explainObject

return a human-readable representation of a ZWave frame



58
59
# File 'lib/ansible/zwave/openzwave/types/valuetype_decimal.rb', line 58

def explain
end

#read_operationObject

define type-specific OZW::Manager API calls



34
35
36
# File 'lib/ansible/zwave/openzwave/types/valuetype_decimal.rb', line 34

def read_operation 
    return :GetValueAsString
end

#to_protocol_value(new_val) ⇒ Object



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

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

#write_operationObject



38
39
40
# File 'lib/ansible/zwave/openzwave/types/valuetype_decimal.rb', line 38

def write_operation
    return :SetValue_String
end