aboutsummaryrefslogtreecommitdiff
path: root/confui
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-01-07 13:47:41 +0100
committerlonkaars <loek@pipeframe.xyz>2023-01-07 13:47:41 +0100
commit847b4a5d588ec504865398c21c3bcb73a6fc1fab (patch)
treebfa918685909acb19731db434277613867d858ac /confui
parentb25530da670709e7d54afd70fe33e1dd6368d45e (diff)
implement get node
Diffstat (limited to 'confui')
-rw-r--r--confui/mainwindow.cpp5
-rw-r--r--confui/ui_node.cpp5
2 files changed, 10 insertions, 0 deletions
diff --git a/confui/mainwindow.cpp b/confui/mainwindow.cpp
index b5bbdf0..4c9b857 100644
--- a/confui/mainwindow.cpp
+++ b/confui/mainwindow.cpp
@@ -7,6 +7,7 @@
#include "ui_tab_automations.h"
#include "ui_tab_node_overview.h"
#include "serial.h"
+#include "../shared/pclient.h"
#include "main.h"
CDMeshConnector *g_cd_mesh_connector = nullptr;
@@ -73,6 +74,10 @@ void CDMainWindow::update() {
QAction* menu_port = menu_options_serialport->addAction(QString::fromStdString(port));
connect(menu_port, &QAction::triggered, this, [this, port](){ menu_set_serial_port(port); });
}
+
+ cd_s_bin* msg = cd_cmd_gen_get_node(true, NULL);
+ cd_pclient_send(msg);
+ free(msg);
}
void CDMainWindow::menu_refresh() { update(); }
diff --git a/confui/ui_node.cpp b/confui/ui_node.cpp
index 56ff004..09daaaa 100644
--- a/confui/ui_node.cpp
+++ b/confui/ui_node.cpp
@@ -1,4 +1,5 @@
#include "ui_node.h"
+#include "../shared/pclient.h"
CDNodeWidget::~CDNodeWidget() {}
CDNodeWidget::CDNodeWidget(QWidget *parent) : QWidget(parent) {
@@ -43,6 +44,10 @@ void CDNodeWidget::update() {
switch_on_off->setChecked(_node->light_on);
button_add_remove->setText(_node->provisioned ? "Remove from network" : "Join network");
+
+ cd_s_bin* msg = cd_cmd_gen_get_node(false, this->_node->uuid);
+ cd_pclient_send(msg);
+ free(msg);
}
void CDNodeWidget::toggle_provision() {