static device identifiers and meta-data for Particle hardware
The static device identifiers and meta-data for Particle hardware.
This project contains the constants as well as very lightweight wrappers around the constants and enables publishing
them as NPM modules and Ruby Gems. All languages' libraries follow the same versioning scheme.
!CI
Installation | Development | Releasing
1. Install Node.js [node@16.x and npm@8.x are required]
1. Clone this repository $ git clone git@github.com:particle-iot-inc/device-constants.git && cd ./device-constants
1. Install dependencies $ npm install
* make sure you are signed into npm and a member of the @particle org (docs)
1. View available commands $ npm run
1. Run the tests $ npm test
1. Start Hacking!
The Device Constants repo contains static specs for official Particle platform devices and the tooling to support publishing a series of language-specific packages with that data. All essential commands are available via npm run - e.g. npm run lint. To view the available commands, run: npm run
To add a new Particle platform device, simply: 1. Open the `` _NOTE: See src/constants.schema.json 3. Validate your additions adhere to the current schema: npm run validateHow to add a new platform
src/constants.json file in your favorite code editor
2. Add a new entry like:js
"example": {
"id":
"name":
"displayName":
"generation": for photon, 3 for boron, 4 for p2>,
"features": , ble>,
"billingConnectivity": , or cellular`>,`
"public":
}, for latest field definitions_git add -p && git commit
4. Stage and commit:
Constants data must adhere to the JSON Schema (https://json-schema.org) specs in src/constants.schema.json 1. Read through the "Getting Started" docsHow to extend the device schema
. In some cases, you may need to extend the current schema to support addition properies, etc. To do that:
2. Open the src/constants.schema.json file in your favorite code editornpm run validate
3. Update the schema with your additions or changes - in some cases, you can jumpstart the process using the online generator at: https://www.jsonschema.net but be sure to scrutinize what it provides as it's not always super-accurate :)
4. Validate your changes have not rendered existing data invalid: git add -p && git commit
5. Stage and commit:
See the src/ruby/README.md file for more info on the Ruby Gem wrapper.
Packages are only released from the main branch after peer review.
1. make sure you have the latest:
* $ git checkout main$ git pull
* $ npm test
1. make sure tests pass
* $ npm run release
1. run the release command
* $ git push origin main --follow-tags`
1. follow the on-screen instructions, wait for confirmation of success
1. push your tags:
*