ESPHome  2024.12.2
Public Member Functions | Protected Attributes
esphome::dfrobot_sen0395::Command Class Referenceabstract

#include <commands.h>

Inheritance diagram for esphome::dfrobot_sen0395::Command:
esphome::dfrobot_sen0395::DetRangeCfgCommand esphome::dfrobot_sen0395::FactoryResetCommand esphome::dfrobot_sen0395::LedModeCommand esphome::dfrobot_sen0395::PowerCommand esphome::dfrobot_sen0395::ReadStateCommand esphome::dfrobot_sen0395::ResetSystemCommand esphome::dfrobot_sen0395::SaveCfgCommand esphome::dfrobot_sen0395::SensitivityCommand esphome::dfrobot_sen0395::SensorCfgStartCommand esphome::dfrobot_sen0395::SetLatencyCommand esphome::dfrobot_sen0395::UartOutputCommand

Public Member Functions

virtual ~Command ()=default
 
virtual uint8_t execute (DfrobotSen0395Component *parent)
 
virtual uint8_t on_message (std::string &message)=0
 

Protected Attributes

DfrobotSen0395Componentparent_ {nullptr}
 
std::string cmd_
 
bool cmd_sent_ {false}
 
int8_t retries_left_ {2}
 
uint32_t cmd_duration_ms_ {1000}
 
uint32_t timeout_ms_ {1500}
 

Detailed Description

Definition at line 16 of file commands.h.

Constructor & Destructor Documentation

◆ ~Command()

virtual esphome::dfrobot_sen0395::Command::~Command ( )
virtualdefault

Member Function Documentation

◆ execute()

uint8_t esphome::dfrobot_sen0395::Command::execute ( DfrobotSen0395Component parent)
virtual

Reimplemented in esphome::dfrobot_sen0395::ReadStateCommand.

Definition at line 14 of file commands.cpp.

◆ on_message()

virtual uint8_t esphome::dfrobot_sen0395::Command::on_message ( std::string &  message)
pure virtual

Field Documentation

◆ cmd_

std::string esphome::dfrobot_sen0395::Command::cmd_
protected

Definition at line 24 of file commands.h.

◆ cmd_duration_ms_

uint32_t esphome::dfrobot_sen0395::Command::cmd_duration_ms_ {1000}
protected

Definition at line 27 of file commands.h.

◆ cmd_sent_

bool esphome::dfrobot_sen0395::Command::cmd_sent_ {false}
protected

Definition at line 25 of file commands.h.

◆ parent_

DfrobotSen0395Component* esphome::dfrobot_sen0395::Command::parent_ {nullptr}
protected

Definition at line 23 of file commands.h.

◆ retries_left_

int8_t esphome::dfrobot_sen0395::Command::retries_left_ {2}
protected

Definition at line 26 of file commands.h.

◆ timeout_ms_

uint32_t esphome::dfrobot_sen0395::Command::timeout_ms_ {1500}
protected

Definition at line 28 of file commands.h.


The documentation for this class was generated from the following files: