LightHub
4.6.0
Open-source smart home controller firmware
Toggle main menu visibility
Loading...
Searching...
No Matches
colorchannel.h
Go to the documentation of this file.
1
2
#pragma once
3
#include "
options.h
"
4
5
6
#include <
abstractout.h
>
7
#include <
item.h
>
8
23
class
colorChannel
:
public
abstractOut
{
24
public
:
25
27
colorChannel
():
iaddr
(0),
numArgs
(0) {};
29
void
link
(
Item
* _item) {
30
abstractOut::link
(_item);
31
iaddr
=
item
->
getArg
();
//Once retrieve and store base address
32
if
(
iaddr
<0)
iaddr
=-
iaddr
;
33
numArgs
=
item
->
getArgCount
();
// and how many addresses is configured
34
};
35
36
int
Ctrl
(
itemCmd
cmd,
char
* subItem=NULL,
bool
toExecute=
true
,
bool
authorized=
false
)
override
;
37
//int getDefaultStorageType()override;
39
virtual
int
PixelCtrl
(
itemCmd
cmd,
char
* subItem=NULL,
bool
show=
true
,
bool
authorized =
false
) =0;
41
short
getChannelAddr
(
short
n =0);
42
// int isActive() override;
43
protected
:
44
short
iaddr
;
45
short
numArgs
;
46
};
abstractout.h
Item
A single LightHub item (virtual channel).
Definition
item.h:232
Item::getArg
int getArg(short n=0)
Definition
item.cpp:507
Item::getArgCount
short getArgCount()
Definition
item.cpp:537
abstractOut::abstractOut
abstractOut()
Definition
abstractout.h:22
abstractOut::link
virtual void link(Item *_item)
Definition
abstractout.h:24
abstractOut::item
Item * item
Item currently linked to this driver.
Definition
abstractout.h:55
colorChannel::getChannelAddr
short getChannelAddr(short n=0)
Get the pin address of the n-th channel (n=0 - base address).
Definition
colorchannel.cpp:12
colorChannel::iaddr
short iaddr
Definition
colorchannel.h:44
colorChannel::link
void link(Item *_item)
Attach to an item; retrieve and store the base address and the number of channel addresses.
Definition
colorchannel.h:29
colorChannel::colorChannel
colorChannel()
Default constructor.
Definition
colorchannel.h:27
colorChannel::Ctrl
int Ctrl(itemCmd cmd, char *subItem=NULL, bool toExecute=true, bool authorized=false) override
Dispatch /set, /HSV and /cmd ON/OFF commands to PixelCtrl.
Definition
colorchannel.cpp:47
colorChannel::numArgs
short numArgs
Definition
colorchannel.h:45
colorChannel::PixelCtrl
virtual int PixelCtrl(itemCmd cmd, char *subItem=NULL, bool show=true, bool authorized=false)=0
Apply the color/brightness command to the output (implemented by the driver).
itemCmd
Command + value container passed between items, drivers and MQTT.
Definition
itemCmd.h:306
item.h
Item (virtual channel) system of LightHub.
options.h
lighthub
colorchannel.h
Generated by
1.18.0