Module: Ansible::KNX::Canonical_1bit
Overview
1-bit canonical values for KNX implements value casting to/from the canonical type, a boolean value
Instance Method Summary collapse
-
#as_canonical_value ⇒ Object
data is 1 ==> true, false otherwise.
-
#to_protocol_value(v) ⇒ Object
v is true? 1 : 0.
Instance Method Details
#as_canonical_value ⇒ Object
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 |