all files / src/core/ Device.js

0% Statements 0/6
100% Branches 0/0
0% Functions 0/1
0% Lines 0/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44                                                                                       
/**
 * User device
 * @access protected
 */
export default class Device {
	/**
	 * Create a device
	 * @param {Webcom/api.DataSnapshot|object} snapData The data snapshot
	 * @access protected
	 */
	constructor(snapData) {
		const values = Object.assign({}, snapData.val());
		/**
		 * Device's unique id
		 * @type string
		 */
		this.uid = snapData.name();
		/**
		 * Device's OS
		 * @type {string}
		 */
		this.os = values.os;
		/**
		 * Device's userAgent
		 * @type {string}
		 */
		this.userAgent = values.userAgent;
		/**
		 * Device's last know status
		 * - CONNECTED
		 * - NOT_CONNECTED
		 * - SLEEPING
		 * @type {string}
		 */
		this.status = values.status;
		/**
		 * Device's sdk
		 * @type {{reach: string, webcom: string}}
		 */
		this.sdk = values.sdk;
		// TODO #Feat: Add 'extra' property for unrestricted additional information ?
	}
}