Module: Ansible::KNX::Canonical_1bit

Included in:
DPT1, DPT2
Defined in:
lib/ansible/knx/dpt/canonical_1bit.rb

Overview

1-bit canonical values for KNX implements value casting to/from the canonical type, a boolean value

Instance Method Summary collapse

Instance Method Details

#as_canonical_valueObject

data is 1 ==> true, false otherwise



41
42
43
# File 'lib/ansible/knx/dpt/canonical_1bit.rb', line 41

def as_canonical_value()
    return (current_value.data.eql?1)
end

#to_protocol_value(v) ⇒ Object

v is true? 1 : 0



46
47
48
# File 'lib/ansible/knx/dpt/canonical_1bit.rb', line 46

def to_protocol_value(v)
    return (v ? 1 : 0)
end