handle exported formats for packed devices

This commit is contained in:
Stewart Allen 2025-12-21 16:33:47 -05:00
commit 478f8b27c5
3 changed files with 4 additions and 0 deletions

View file

@ -76,6 +76,9 @@ function device_from_code(code,mode) {
// presence of internal field indicates already converted
if (code.internal >= 0) return code;
// presence of nested code field indicates newer encoding
if (code.code) return code.code;
// if (self.navigator) console.log({mode, convert: code});
let cmd = code.cmd || {},
set = code.settings || {},

View file

@ -117,6 +117,7 @@ function setDeviceCode(code, devicename) {
api.event.emit('device.select', devicename);
try {
if (typeof(code) === 'string') code = js2o(code) || {};
if (code.code) code = code.code;
let mode = api.mode.get(),
lmode = mode.toLowerCase(),