LightHub 4.6.0
Open-source smart home controller firmware
Loading...
Searching...
No Matches
out_counter.h
Go to the documentation of this file.
1
2#pragma once
3#include "options.h"
4#ifndef COUNTER_DISABLE
5
6#include <abstractout.h>
7#include <item.h>
8
25class out_counter : public abstractOut {
26public:
28 int Setup() override;
30 int Poll(short cause) override;
32 int Stop() override;
34 int getChanType() override;
36 int Ctrl(itemCmd cmd, char* subItem=NULL, bool toExecute=true, bool authorized = false) override;
37};
38#endif
abstractOut()
Definition abstractout.h:22
Command + value container passed between items, drivers and MQTT.
Definition itemCmd.h:306
Auto-summing (virtual) counter driver, channel type CH_COUNTER = 20.
Definition out_counter.h:25
int Poll(short cause) override
When the tick period expires, adds impulse_coef to the stored value and sends the status.
Definition out_counter.cpp:27
int Setup() override
Initializes the channel state (CST_INITIALIZED); no hardware.
Definition out_counter.cpp:12
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).
Definition out_counter.cpp:54
int Stop() override
Marks the channel as unknown.
Definition out_counter.cpp:19
int getChanType() override
Returns CH_COUNTER (20).
Definition out_counter.cpp:117
Item (virtual channel) system of LightHub.