Class: ESPHome::Cli::Entities::Switch

Inherits:
Menu show all
Defined in:
lib/esphome/cli/entities/switch.rb

Instance Attribute Summary

Attributes inherited from ESPHome::Cli::Entity

#cli, #index

Instance Method Summary collapse

Methods inherited from Menu

#activate

Methods inherited from ESPHome::Cli::Entity

#initialize, #move_left, #move_right, #print, #touch

Constructor Details

This class inherits a constructor from ESPHome::Cli::Entity

Instance Method Details

#command(command) ⇒ Object



11
12
13
14
# File 'lib/esphome/cli/entities/switch.rb', line 11

def command(command)
  cli.info("Turning #{object_id_} #{command}")
  __send__(command.to_sym)
end

#optionsObject



9
# File 'lib/esphome/cli/entities/switch.rb', line 9

def options = %w[on off]