LightHub 4.6.0
Open-source smart home controller firmware
Loading...
Searching...
No Matches
abstractIn Class Reference

Base class of input driver modules (sensors, encoders, ...). More...

#include <abstractin.h>

Inheritance diagram for abstractIn:

Public Member Functions

 abstractIn (Input *_in)
Public Member Functions inherited from abstractCh
 abstractCh ()
virtual ~abstractCh ()
virtual int Poll (short cause)
virtual int Setup ()=0
virtual int Stop ()
virtual int Status ()
virtual void setStatus (uint8_t status)

Protected Member Functions

int publish (long value, const char *subtopic=NULL)
int publish (float value, const char *subtopic=NULL)
int publish (char *value, const char *subtopic=NULL)
Protected Member Functions inherited from abstractCh
int publishTopic (const char *topic, long value, const char *subtopic=NULL)
int publishTopic (const char *topic, float value, const char *subtopic=NULL)
int publishTopic (const char *topic, const char *value, const char *subtopic=NULL, const char *suffix=NULL)

Protected Attributes

Input * in
 Pointer to the Input (config entry) this driver is attached to.
friend Input

Detailed Description

Base class of input driver modules (sensors, encoders, ...).

abstractIn extends abstractCh for drivers attached to an Input. The in pointer references the Input's config entry; the protected publish() helpers convert the measured value to a string and publish it to the MQTT topic given by the "emit" field of the input.

Constructor & Destructor Documentation

◆ abstractIn()

abstractIn::abstractIn ( Input * _in)
inline

Member Function Documentation

◆ publish() [1/3]

int abstractIn::publish ( char * value,
const char * subtopic = NULL )
protected

Publish a string reading to the input's "emit" topic (retained).

◆ publish() [2/3]

int abstractIn::publish ( float value,
const char * subtopic = NULL )
protected

Publish a float reading to the input's "emit" topic (retained).

◆ publish() [3/3]

int abstractIn::publish ( long value,
const char * subtopic = NULL )
protected

Publish an integer reading to the input's "emit" topic (retained).

Member Data Documentation

◆ in

Input* abstractIn::in
protected

Pointer to the Input (config entry) this driver is attached to.

◆ Input

friend abstractIn::Input
protected

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