-
Notifications
You must be signed in to change notification settings - Fork 388
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support payload normalization (#508)
* Fix link * Fix downlink decoder examples * Update dependencies * Initial support for payload normalization * Upgrade to Go 1.18 * Add validation for atmospheric pressure * Extract normalized payload to own schema file * Use percentage for relative humidity * Refer to TTS documentation for codecs
- Loading branch information
1 parent
cfe6c7a
commit d810556
Showing
12 changed files
with
431 additions
and
1,100 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://schema.thethings.network/devicerepository/1/payload/schema", | ||
"title": "LoRaWAN Device Repository Payload", | ||
"description": "Payload definitions for the LoRaWAN Device Repository", | ||
"definitions": { | ||
"temperature": { | ||
"type": "number", | ||
"description": "Temperature (°C)", | ||
"minimum": -273.15 | ||
}, | ||
"direction": { | ||
"type": "number", | ||
"description": "Direction (°)", | ||
"minimum": 0, | ||
"exclusiveMaximum": 360 | ||
}, | ||
"speed": { | ||
"type": "number", | ||
"description": "Speed (m/s)", | ||
"minimum": 0 | ||
}, | ||
"percentage": { | ||
"type": "number", | ||
"description": "Percentage (%)", | ||
"minimum": 0, | ||
"maximum": 100 | ||
}, | ||
"measurement": { | ||
"type": "object", | ||
"properties": { | ||
"time": { | ||
"type": "string", | ||
"format": "date-time", | ||
"description": "Date and time of the measurement (RFC3339)" | ||
}, | ||
"air": { | ||
"type": "object", | ||
"properties": { | ||
"temperature": { | ||
"description": "Air temperature (°C)", | ||
"$ref": "#/definitions/temperature" | ||
}, | ||
"relativeHumidity": { | ||
"description": "Relative humidity (%)", | ||
"$ref": "#/definitions/percentage" | ||
}, | ||
"pressure": { | ||
"type": "number", | ||
"description": "Atmospheric pressure (hPa)", | ||
"minimum": 900, | ||
"maximum": 1100 | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"wind": { | ||
"type": "object", | ||
"properties": { | ||
"speed": { | ||
"description": "Wind speed (m/s)", | ||
"$ref": "#/definitions/speed" | ||
}, | ||
"direction": { | ||
"description": "Wind direction (°)", | ||
"$ref": "#/definitions/direction" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"uplinkPayload": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/measurement" | ||
} | ||
} | ||
}, | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/definitions/uplinkPayload" | ||
} | ||
] | ||
} |
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
Oops, something went wrong.