Проблема со строковыми контролами.
defineVirtualDevice(‘moveTime’, {
title: ‘sensors’,
cells: {
person: {
type: ‘text’,
value: ‘’
},
access: {
type: ‘switch’,
value: false,
readonly: true
}
}
});
defineRule(‘card_read’, {
whenChanged: card_reader_device + ‘/’ + card_reader_number,
then: function (newValue, devName, cellName) {
var card_id = parseInt(newValue);
if (card_id > 0) {
var ownerName = ‘Stranger’;
var cardAccess = false;
log("{}'s card activated: {}", ownerName, card_id);
dev[‘moveTime’][‘access’] = cardAccess;
dev[‘moveTime’][‘person’] = ownerName;
log(“Saved values card = {}; acess = {}”, dev[‘moveTime’][‘person’], dev[‘moveTime’][‘access’]);
}
}
});
WebUI отображает правильно - person: Stranger
Log:
2020-03-30 13:53:50 Stranger’s card activated: 1223345951
2020-03-30 13:53:50 Saved values card = null; acess = false
Во всех правилах которые используют dev[‘moveTime’][‘person’] возвращается null. В чем проблема?