ESPHome  2024.11.1
Data Structures | Enumerations | Functions | Variables
esphome::switch_ Namespace Reference

Data Structures

class  Switch
 Base class for all switches. More...
 
class  SwitchCondition
 
class  SwitchPublishAction
 
class  SwitchTurnOffTrigger
 
class  SwitchTurnOnTrigger
 
class  ToggleAction
 
class  TurnOffAction
 
class  TurnOnAction
 

Enumerations

enum  SwitchRestoreMode {
  SWITCH_ALWAYS_OFF = !RESTORE_MODE_ON_MASK, SWITCH_ALWAYS_ON = RESTORE_MODE_ON_MASK, SWITCH_RESTORE_DEFAULT_OFF = RESTORE_MODE_PERSISTENT_MASK, SWITCH_RESTORE_DEFAULT_ON = RESTORE_MODE_PERSISTENT_MASK | RESTORE_MODE_ON_MASK,
  SWITCH_RESTORE_INVERTED_DEFAULT_OFF = RESTORE_MODE_PERSISTENT_MASK | RESTORE_MODE_INVERTED_MASK, SWITCH_RESTORE_INVERTED_DEFAULT_ON = RESTORE_MODE_PERSISTENT_MASK | RESTORE_MODE_INVERTED_MASK | RESTORE_MODE_ON_MASK, SWITCH_RESTORE_DISABLED = RESTORE_MODE_DISABLED_MASK
}
 

Functions

void log_switch (const char *tag, const char *prefix, const char *type, Switch *obj)
 

Variables

const int RESTORE_MODE_ON_MASK = 0x01
 
const int RESTORE_MODE_PERSISTENT_MASK = 0x02
 
const int RESTORE_MODE_INVERTED_MASK = 0x04
 
const int RESTORE_MODE_DISABLED_MASK = 0x08
 

Enumeration Type Documentation

◆ SwitchRestoreMode

Enumerator
SWITCH_ALWAYS_OFF 
SWITCH_ALWAYS_ON 
SWITCH_RESTORE_DEFAULT_OFF 
SWITCH_RESTORE_DEFAULT_ON 
SWITCH_RESTORE_INVERTED_DEFAULT_OFF 
SWITCH_RESTORE_INVERTED_DEFAULT_ON 
SWITCH_RESTORE_DISABLED 

Definition at line 24 of file switch.h.

Function Documentation

◆ log_switch()

void esphome::switch_::log_switch ( const char *  tag,
const char *  prefix,
const char *  type,
Switch obj 
)

Definition at line 66 of file switch.cpp.

Variable Documentation

◆ RESTORE_MODE_DISABLED_MASK

const int esphome::switch_::RESTORE_MODE_DISABLED_MASK = 0x08

Definition at line 22 of file switch.h.

◆ RESTORE_MODE_INVERTED_MASK

const int esphome::switch_::RESTORE_MODE_INVERTED_MASK = 0x04

Definition at line 21 of file switch.h.

◆ RESTORE_MODE_ON_MASK

const int esphome::switch_::RESTORE_MODE_ON_MASK = 0x01

Definition at line 19 of file switch.h.

◆ RESTORE_MODE_PERSISTENT_MASK

const int esphome::switch_::RESTORE_MODE_PERSISTENT_MASK = 0x02

Definition at line 20 of file switch.h.