feat: check sudo rights for mqtt #62

This commit is contained in:
leukipp
2025-09-03 16:01:47 +02:00
parent 2737eabd8a
commit ef2093a25e
3 changed files with 48 additions and 36 deletions
+6
View File
@@ -186,6 +186,9 @@ const publishState = (path, state) => {
* Initializes the shutdown button and handles the execute logic.
*/
const initShutdown = () => {
if (!HARDWARE.support.sudoRights) {
return;
}
const root = `${INTEGRATION.root}/shutdown`;
const config = {
name: "Shutdown",
@@ -209,6 +212,9 @@ const initShutdown = () => {
* Initializes the reboot button and handles the execute logic.
*/
const initReboot = () => {
if (!HARDWARE.support.sudoRights) {
return;
}
const root = `${INTEGRATION.root}/reboot`;
const config = {
name: "Reboot",