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
|
// presence of internal field indicates already converted
|
||||||
if (code.internal >= 0) return code;
|
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});
|
// if (self.navigator) console.log({mode, convert: code});
|
||||||
let cmd = code.cmd || {},
|
let cmd = code.cmd || {},
|
||||||
set = code.settings || {},
|
set = code.settings || {},
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,7 @@ function setDeviceCode(code, devicename) {
|
||||||
api.event.emit('device.select', devicename);
|
api.event.emit('device.select', devicename);
|
||||||
try {
|
try {
|
||||||
if (typeof(code) === 'string') code = js2o(code) || {};
|
if (typeof(code) === 'string') code = js2o(code) || {};
|
||||||
|
if (code.code) code = code.code;
|
||||||
|
|
||||||
let mode = api.mode.get(),
|
let mode = api.mode.get(),
|
||||||
lmode = mode.toLowerCase(),
|
lmode = mode.toLowerCase(),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue