handle exported formats for packed devices
This commit is contained in:
parent
a3066fb42e
commit
478f8b27c5
3 changed files with 4 additions and 0 deletions
|
|
@ -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 || {},
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue