Support multi backend items

This commit is contained in:
2020-05-05 22:20:00 +02:00
parent 14432ae200
commit bcd835aca6
10 changed files with 276 additions and 121 deletions

24
uvositem.cpp Normal file
View File

@ -0,0 +1,24 @@
#include "uvositem.h"
UvosItem::UvosItem(const uint8_t idIn, char nameIn[])
{
id = 129 << 8 + idIn;
type = 1;
}
UvosItem::UvosItem(const Item& item)
{
Item::operator=(item);
type = 1;
}
void UvosItem::setValue(const uint8_t value)
{
const uint8_t paket[4] = {id >> 8, id & 0x00FF, 0, value};
if(transmitter)transmitter->send(paket, 4);
}
void UvosItem::resend()
{
setValue(lastValue);
}