resin-device-status
Resin.io device status interpreter
Role
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 Resin SDK instead.
Installation
Installresin-device-status
by running:$ npm install --save resin-device-status
Documentation
* [.status](#module_deviceStatus.status) : <code>Object</code>
* [.statuses](#module_deviceStatus.statuses) : <code>Array.<Object></code>
* [.getStatus(device)](#module_deviceStatus.getStatus) ⇒ <code>Promise</code>
deviceStatus.status : Object
Kind: static constant of deviceStatus
Summary: Map of possible device statuses
Access: public
deviceStatus.statuses : Array.<Object>
Kind: static constant of deviceStatus
Summary: Array of device statuses along with their display names
Access: public
deviceStatus.getStatus(device) ⇒ Promise
Kind: static method of deviceStatus
Summary: Get status of a device
Access: public
Fulfil:
Object
- device status| Param | Type | Description | | --- | --- | --- | | device |
Object
| device |Example
resin = require('resin-sdk')
deviceStatus = require('resin-device-status')
resin.models.device.get('9174944').then (device) ->
deviceStatus.getStatus(device).then (status) ->
console.log(status.key)
console.log(status.name)
Support
If you're having any problem, please raise an issue on GitHub and the Resin.io team will be happy to help.Tests
Run the test suite by doing:$ npm test
Contribute
- Issue Tracker: github.com/resin-io/resin-device-status/issues
- Source Code: github.com/resin-io/resin-device-status
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
$ npm run lint