MQTT rework v0.1 + Settings UI improvements ⚙

This commit is contained in:
Jokob-sk
2023-10-14 15:35:09 +11:00
parent a3702fed94
commit 8ad63ba07d
34 changed files with 704 additions and 114 deletions

View File

@@ -487,7 +487,21 @@ function getNameByMacAddress(macAddress) {
}
// -----------------------------------------------------------------------------
//
// A function used to make the IP address orderable
function formatIPlong(ipAddress) {
const parts = ipAddress.split('.');
if (parts.length !== 4) {
throw new Error('Invalid IP address format');
}
return (parseInt(parts[0]) << 24) |
(parseInt(parts[1]) << 16) |
(parseInt(parts[2]) << 8) |
parseInt(parts[3]);
}
// -----------------------------------------------------------------------------
// A function to get a device property using the mac address as key and DB column nakme as parameter
// for the value to be returned
function getDeviceDataByMacAddress(macAddress, dbColumn) {
const sessionDataKey = 'devicesListAll_JSON';