import{connect}from'@studioxid/omni-adapter';constclient = awaitconnect({secretKey:process.env.CONNECT_TOKEN!,displayName:'smart-home-dashboard',sends:['climate.temperature.request'],receives:['climate.temperature'],});// Receive the confirmed temperature.client.on('climate.temperature',(msg)=>{console.log('Confirmed temperature:',msg.value);// Update the dashboard through your app's UI logic.});// Call this from your server-side handler// when the user changes the temperature.exportasyncfunctionrequestTemperature(value: number){awaitclient.send('climate.temperature.request',value);}client.on('error',(err)=>{console.error(`[${err.code}] ${err.hint ?? err.message}`);});for(constsignalof['SIGINT','SIGTERM']asconst){process.once(signal,()=>voidclient.close());}
import{connect}from'@studioxid/omni-adapter';constclient = awaitconnect({secretKey:process.env.CONNECT_TOKEN!,displayName:'smart-home-dashboard',sends:['climate.temperature.request'],receives:['climate.temperature'],});// Receive the confirmed temperature.client.on('climate.temperature',(msg)=>{console.log('Confirmed temperature:',msg.value);// Update the dashboard through your app's UI logic.});// Call this from your server-side handler// when the user changes the temperature.exportasyncfunctionrequestTemperature(value: number){awaitclient.send('climate.temperature.request',value);}client.on('error',(err)=>{console.error(`[${err.code}] ${err.hint ?? err.message}`);});for(constsignalof['SIGINT','SIGTERM']asconst){process.once(signal,()=>voidclient.close());}
import{connect}from'@studioxid/omni-adapter';constclient = awaitconnect({secretKey:process.env.CONNECT_TOKEN!,displayName:'smart-home-dashboard',sends:['climate.temperature.request'],receives:['climate.temperature'],});// Receive the confirmed temperature.client.on('climate.temperature',(msg)=>{console.log('Confirmed temperature:',msg.value);// Update the dashboard through your app's UI logic.});// Call this from your server-side handler// when the user changes the temperature.exportasyncfunctionrequestTemperature(value: number){awaitclient.send('climate.temperature.request',value);}client.on('error',(err)=>{console.error(`[${err.code}] ${err.hint ?? err.message}`);});for(constsignalof['SIGINT','SIGTERM']asconst){process.once(signal,()=>voidclient.close());}
import{connect}from'@studioxid/omni-adapter';constclient = awaitconnect({secretKey:process.env.CONNECT_TOKEN!,displayName:'smart-home-dashboard',sends:['climate.temperature.request'],receives:['climate.temperature'],});// Receive the confirmed temperature.client.on('climate.temperature',(msg)=>{console.log('Confirmed temperature:',msg.value);// Update the dashboard through your app's UI logic.});// Call this from your server-side handler// when the user changes the temperature.exportasyncfunctionrequestTemperature(value: number){awaitclient.send('climate.temperature.request',value);}client.on('error',(err)=>{console.error(`[${err.code}] ${err.hint ?? err.message}`);});for(constsignalof['SIGINT','SIGTERM']asconst){process.once(signal,()=>voidclient.close());}
import{connect}from'@studioxid/omni-adapter';constclient = awaitconnect({secretKey:process.env.CONNECT_TOKEN!,displayName:'smart-home-dashboard',sends:['climate.temperature.request'],receives:['climate.temperature'],});// Receive the confirmed temperature.client.on('climate.temperature',(msg)=>{console.log('Confirmed temperature:',msg.value);// Update the dashboard through your app's UI logic.});// Call this from your server-side handler// when the user changes the temperature.exportasyncfunctionrequestTemperature(value: number){awaitclient.send('climate.temperature.request',value);}client.on('error',(err)=>{console.error(`[${err.code}] ${err.hint ?? err.message}`);});for(constsignalof['SIGINT','SIGTERM']asconst){process.once(signal,()=>voidclient.close());}