Last active
April 17, 2023 21:40
-
-
Save RandomGenericUsername/36e25eb6bfa3795555956e965fed9872 to your computer and use it in GitHub Desktop.
testDaaS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function XYZDeviceDecoder(args) | |
{ | |
var bytes = args.bytes; | |
var port = args.fport; | |
var status = args.status; | |
var temperature = bytes[0] || bytes[1] << 8; | |
var humidity = bytes[2] || bytes[3] << 8; | |
//return {"temp" : 0, "humidity" : 1}; | |
return {"temperature" : temperature, "humidity" : humidity, "raw" : bytes, "port" : port, "status" : {"value" : 1, "context" : status}}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment