Class: OpenHAB::Core::Types::UpDownType

Inherits:
Object
  • Object
show all
Includes:
Command, State
Defined in:
lib/openhab/core/types/up_down_type.rb

Overview

Implements the UP and DOWN commands.

Also, PercentType can be converted to UpDownType for more semantic comparisons. 0 is UP, 100 is DOWN, and anything in-between is neither.

Constant Summary collapse

UP =

Up Command/State

DOWN =

Down Command/State

Instance Method Summary collapse

Methods included from Type

#==, #eql?

Instance Method Details

#!UpDownType

Invert the type

Returns:



38
39
40
41
42
# File 'lib/openhab/core/types/up_down_type.rb', line 38

def !
  return UP if down?

  DOWN if up?
end

#down?true, false

Check if self == DOWN

Returns:

  • (true, false)


# File 'lib/openhab/core/types/up_down_type.rb', line 29

#up?true, false

Check if self == UP

Returns:

  • (true, false)


# File 'lib/openhab/core/types/up_down_type.rb', line 25