LightHub
4.6.0
Open-source smart home controller firmware
Toggle main menu visibility
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
25
class
out_counter
:
public
abstractOut
{
26
public
:
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.h
abstractOut::abstractOut
abstractOut()
Definition
abstractout.h:22
itemCmd
Command + value container passed between items, drivers and MQTT.
Definition
itemCmd.h:306
out_counter
Auto-summing (virtual) counter driver, channel type CH_COUNTER = 20.
Definition
out_counter.h:25
out_counter::Poll
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
out_counter::Setup
int Setup() override
Initializes the channel state (CST_INITIALIZED); no hardware.
Definition
out_counter.cpp:12
out_counter::Ctrl
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
out_counter::Stop
int Stop() override
Marks the channel as unknown.
Definition
out_counter.cpp:19
out_counter::getChanType
int getChanType() override
Returns CH_COUNTER (20).
Definition
out_counter.cpp:117
item.h
Item (virtual channel) system of LightHub.
options.h
lighthub
modules
out_counter.h
Generated by
1.18.0