Add unit support to sensors

This commit is contained in:
Carl Philipp Klemm 2026-03-29 22:11:10 +02:00
parent 3e0ba165e8
commit 37c0c5d17b
12 changed files with 73 additions and 41 deletions

View file

@ -38,9 +38,11 @@ void TcpServer::processIncomeingJson(const QByteArray& jsonbytes)
{
QJsonObject jsonobject = itemjson.toObject();
std::shared_ptr<Item> item = Item::loadItem(jsonobject);
item->setLoaded(FullList);
if(item)
{
item->setLoaded(FullList);
items.push_back(item);
}
}
if(FullList && !items.empty())
{
@ -60,6 +62,7 @@ void TcpServer::processIncomeingJson(const QByteArray& jsonbytes)
bool TcpServer::launch(const QHostAddress &address, quint16 port)
{
qInfo()<<"Tcp server launched on"<<address<<"port"<<port;
return server.listen(address, port);
}