Class: ESPHome::Cli::Entities::Form
Instance Attribute Summary
#cli, #index
Instance Method Summary
collapse
#move_left, #move_right, #print, #touch
Constructor Details
#initialize ⇒ Form
Returns a new instance of Form.
77
78
79
80
81
|
# File 'lib/esphome/cli/entities/form.rb', line 77
def initialize(...)
super
@max_length = length_range&.end || 10
end
|
Instance Method Details
#activate ⇒ Object
91
92
93
94
95
96
97
|
# File 'lib/esphome/cli/entities/form.rb', line 91
def activate
value = prompt_form(form_title,
initial_value:,
suffix:,
field_width:)
command(value) if value
end
|
#initial_value ⇒ Object
89
|
# File 'lib/esphome/cli/entities/form.rb', line 89
def initial_value = nil
|
#length_range ⇒ Object
83
84
85
|
# File 'lib/esphome/cli/entities/form.rb', line 83
def length_range
0..10
end
|
#suffix ⇒ Object
87
|
# File 'lib/esphome/cli/entities/form.rb', line 87
def suffix = nil
|