Private
Public Access
2
0
Files
mraa/jsstub/test/lightbulb.js
Thomas Ingleby 170bdd104f spdx: add spdx tags to most files
Large change that removes the duplicated MIT notice withe a spdx tag

Signed-off-by: Thomas Ingleby <thomas.ingleby@intel.com>
2019-05-23 10:09:12 -07:00

39 lines
885 B
JavaScript

/*
* Author: David Antler <david.a.antler@intel.com>
* Copyright (c) 2016 Intel Corporation.
*
* SPDX-License-Identifier: MIT
*
*
* @fileoverview Implementation of a LightBulb class abstraction
*
*/
module.exports = (function() {
"use strict";
var m = require('../index');
/**
* Constructor for a new LightBulb
* @class LightBulb
*
* @classdesc This class abstracts access to the control and data registers
* on an imaginary lightbulb.
* @param {Object} A libmraa I2c object, initialized
*/
function LightBulb (i2cInterface) {
var self = this;
self._i2cInterface = i2cInterface;
self.getBrightness = function() {
// Presume our brightness data is one byte at offset 4
return self._i2cInterface.readReg(4);
}
return self;
}
return LightBulb;
})();