|
LightHub 4.6.0
Open-source smart home controller firmware
|
Auto-summing (virtual) counter driver, channel type CH_COUNTER = 20. More...
#include <out_counter.h>
Public Member Functions | |
| int | Setup () override |
| Initializes the channel state (CST_INITIALIZED); no hardware. | |
| int | Poll (short cause) override |
| When the tick period expires, adds impulse_coef to the stored value and sends the status. | |
| int | Stop () override |
| Marks the channel as unknown. | |
| int | getChanType () override |
| Returns CH_COUNTER (20). | |
| int | Ctrl (itemCmd cmd, char *subItem=NULL, bool toExecute=true, bool authorized=false) override |
| Starts/stops accumulation via /set (non-zero value) and /cmd on/off (see class doc). | |
| Public Member Functions inherited from abstractOut | |
| abstractOut () | |
| virtual void | link (Item *_item) |
| virtual int | isActive () |
| virtual bool | isAllowed (itemCmd cmd) |
| virtual itemCmd | getDefaultOnVal () |
| virtual int | Status () override |
| virtual void | setStatus (uint8_t status) override |
| Item * | getItem () |
| Public Member Functions inherited from abstractCh | |
| abstractCh () | |
| virtual | ~abstractCh () |
Additional Inherited Members | |
| Protected Member Functions inherited from abstractOut | |
| int | pubAction (bool state) |
| 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 inherited from abstractOut | |
| Item * | item |
| Item currently linked to this driver. | |
Auto-summing (virtual) counter driver, channel type CH_COUNTER = 20.
No GPIO involved: every configured period the driver adds a fixed impulse value to the stored channel value (software "tick" generator).
JSON config (itemArg): [impulse_coef, period_sec]
Ctrl:
Status: the accumulated counter value, republished after every tick.
|
overridevirtual |
Starts/stops accumulation via /set (non-zero value) and /cmd on/off (see class doc).
Implements abstractOut.
|
overridevirtual |
Returns CH_COUNTER (20).
Reimplemented from abstractOut.
|
overridevirtual |
When the tick period expires, adds impulse_coef to the stored value and sends the status.
Reimplemented from abstractCh.
|
overridevirtual |
Initializes the channel state (CST_INITIALIZED); no hardware.
Reimplemented from abstractOut.
|
overridevirtual |
Marks the channel as unknown.
Reimplemented from abstractCh.