ESPHome 2025.12.0-dev
Loading...
Searching...
No Matches
select_call.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace esphome {
6namespace select {
7
8class Select;
9
18
20 public:
21 explicit SelectCall(Select *parent) : parent_(parent) {}
22 void perform();
23
24 SelectCall &set_option(const std::string &option);
25 SelectCall &set_option(const char *option);
26 SelectCall &set_index(size_t index);
27
28 SelectCall &select_next(bool cycle);
29 SelectCall &select_previous(bool cycle);
32
34 SelectCall &with_cycle(bool cycle);
35 SelectCall &with_option(const std::string &option);
36 SelectCall &with_option(const char *option);
37 SelectCall &with_index(size_t index);
38
39 protected:
40 __attribute__((always_inline)) inline optional<size_t> calculate_target_index_(const char *name);
41
45 bool cycle_;
46};
47
48} // namespace select
49} // namespace esphome
SelectCall & select_next(bool cycle)
SelectCall & with_index(size_t index)
optional< size_t > index_
Definition select_call.h:43
SelectCall(Select *parent)
Definition select_call.h:21
SelectCall & with_cycle(bool cycle)
SelectCall & select_previous(bool cycle)
SelectOperation operation_
Definition select_call.h:44
SelectCall & with_operation(SelectOperation operation)
__attribute__((always_inline)) inline optional< size_t > calculate_target_index_(const char *name)
SelectCall & set_index(size_t index)
SelectCall & set_option(const std::string &option)
SelectCall & with_option(const std::string &option)
Base-class for all selects.
Definition select.h:31
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7