DEPRECATED - Use the overall_status
field on the device
resource instead.
Balena device status interpreter
The intention of this module is to provide an encapsulated way to interpret the different device properties as a human readable device status.
THIS MODULE IS LOW LEVEL AND IS NOT MEANT TO BE USED BY END USERS DIRECTLY.
Unless you know what you're doing, use the Balena SDK instead.
Install balena-device-status
by running:
$ npm install --save balena-device-status
- deviceStatus
- .status :
Object
- .statuses :
Array.<Object>
- .getStatus(device) ⇒
Promise
- .status :
Kind: static constant of deviceStatus
Summary: Map of possible device statuses
Access: public
Kind: static constant of deviceStatus
Summary: Array of device statuses along with their display names
Access: public
Kind: static method of deviceStatus
Summary: Get status of a device
Access: public
Fulfil: Object
- device status
Param | Type | Description |
---|---|---|
device | Object |
device |
Example
balena = require('balena-sdk')
deviceStatus = require('balena-device-status')
balena.models.device.get('9174944').then (device) ->
deviceStatus.getStatus(device).then (status) ->
console.log(status.key)
console.log(status.name)
If you're having any problem, please raise an issue on GitHub and the Balena team will be happy to help.
Run the test suite by doing:
$ npm test
- Issue Tracker: github.com/balena-io-modules/balena-device-status/issues
- Source Code: github.com/balena-io-modules/balena-device-status
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
$ npm run lint
The project is licensed under the Apache 2.0 license.