mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
fix standalone server for handling customizations
This commit is contained in:
@@ -929,13 +929,13 @@ rest_server.post(EMSESP_DEVICEENTITIES_ENDPOINT, (req, res) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function updateMask(entity, de, dd) {
|
function updateMask(entity, de, dd) {
|
||||||
const name = entity.slice(2)
|
const shortname = entity.slice(2)
|
||||||
const new_mask = parseInt(entity.slice(0, 2), 16)
|
const new_mask = parseInt(entity.slice(0, 2), 16)
|
||||||
|
|
||||||
objIndex = de.findIndex((obj) => obj.s == name)
|
objIndex = de.findIndex((obj) => obj.id == shortname)
|
||||||
if (objIndex !== -1) {
|
if (objIndex !== -1) {
|
||||||
de[objIndex].m = new_mask
|
de[objIndex].m = new_mask
|
||||||
const fullname = de[objIndex].id
|
const fullname = de[objIndex].n
|
||||||
objIndex = dd.data.findIndex((obj) => obj.id.slice(2) == fullname)
|
objIndex = dd.data.findIndex((obj) => obj.id.slice(2) == fullname)
|
||||||
if (objIndex !== -1) {
|
if (objIndex !== -1) {
|
||||||
// see if the mask has changed
|
// see if the mask has changed
|
||||||
@@ -947,7 +947,7 @@ function updateMask(entity, de, dd) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("can't locate record for id " + id)
|
console.log("can't locate record for name " + shortname)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user