Skip to content

Instantly share code, notes, and snippets.

@vishal-pandey
Created June 16, 2020 17:01
Show Gist options
  • Save vishal-pandey/f0e16596d5d2e3e7be2136914b7d6cc7 to your computer and use it in GitHub Desktop.
Save vishal-pandey/f0e16596d5d2e3e7be2136914b7d6cc7 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Package IOTC</title>
<script type="text/javascript" src="http://18.221.22.148/iotc-js/iotc.js"></script>
</head>
<body>
<h1 align="center">IOT Made simple</h1>
<script type="text/javascript">
IOTC_connect("__APP_KEY__")
onConnect = ()=>{
console.log("Hello")
subscribe('bulb')
subscribe('ac')
send('bulb', 'on')
}
onReceive = (msg, deviceId)=>{
console.log(msg)
console.log(deviceId)
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment