LightHub 4.6.0
Open-source smart home controller firmware
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
23class colorChannel : public abstractOut {
24public:
25
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;
43protected:
44 short iaddr;
45 short numArgs;
46};
A single LightHub item (virtual channel).
Definition item.h:232
int getArg(short n=0)
Definition item.cpp:507
short getArgCount()
Definition item.cpp:537
abstractOut()
Definition abstractout.h:22
virtual void link(Item *_item)
Definition abstractout.h:24
Item * item
Item currently linked to this driver.
Definition abstractout.h:55
short getChannelAddr(short n=0)
Get the pin address of the n-th channel (n=0 - base address).
Definition colorchannel.cpp:12
short iaddr
Definition colorchannel.h:44
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()
Default constructor.
Definition colorchannel.h:27
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
short numArgs
Definition colorchannel.h:45
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).
Command + value container passed between items, drivers and MQTT.
Definition itemCmd.h:306
Item (virtual channel) system of LightHub.