zigbee2mqtt/test/utils.js
Laurent 7cd30a3a05 configurable last_seen (#874)
* configurable last_seen

* Refactor last_seen.
2019-01-18 20:31:55 +01:00

14 lines
506 B
JavaScript

const logger = require('../lib/util/logger');
module.exports = {
stubLogger: (sandbox) => {
sandbox.stub(logger, 'info').callsFake(() => {});
sandbox.stub(logger, 'warn').callsFake(() => {});
sandbox.stub(logger, 'debug').callsFake(() => {});
sandbox.stub(logger, 'error').callsFake(() => {});
},
zigbeeMessage: (device, cid, type, data, epId) => {
return {data: {cid: cid, data: data}, type: type, endpoints: [{device: device, epId: epId}]};
},
};