diff --git a/scripts/connect.ts b/scripts/connect.ts index 836e0237..acb61084 100644 --- a/scripts/connect.ts +++ b/scripts/connect.ts @@ -74,7 +74,7 @@ const main = async (args: { deviceId: string }) => { deviceUiUrl, deviceId: clientId, onUpdate: update => { - console.log({ clientId, state: { state: { reported: update } } }) + console.log(chalk.magenta('<'), chalk.cyan(JSON.stringify(update))) connection.update(clientId, { state: { reported: update } }) }, }) @@ -88,15 +88,8 @@ const main = async (args: { deviceId: string }) => { console.log(chalk.magenta('reconnecting...')) }) - connection.on('status', function(thingName, stat, _, stateObject) { - console.log( - 'received ' + - stat + - ' on ' + - thingName + - ': ' + - JSON.stringify(stateObject), - ) + connection.on('status', (_, stat) => { + console.log(chalk.magenta('>'), chalk.cyan(stat)) }) connection.on('delta', function(thingName, stateObject) { diff --git a/scripts/device/ui-server.ts b/scripts/device/ui-server.ts index 5f98b14f..f3564989 100644 --- a/scripts/device/ui-server.ts +++ b/scripts/device/ui-server.ts @@ -35,7 +35,6 @@ export const uiServer = async (args: { }) request.on('end', () => { try { - console.log(body) const update = JSON.parse(body) args.onUpdate(update) response.writeHead(202, {