-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshittyservice.js
50 lines (43 loc) · 1.38 KB
/
shittyservice.js
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
45
46
47
48
49
50
/**
* Dependencies
**/
var bleno = require('/usr/local/lib/node_modules/bleno');
var util = require('util');
/**
* Types
**/
var PrimaryService = bleno.PrimaryService;
/**
* Types
**/
var CharacteristicWaterFlow = require('./characteristic_waterflow');
var CharacteristicAroma = require('./characteristic_aroma');
var CharacteristicOccupation = require('./characteristic_occupation');
var CharacteristicPaper = require('./characteristic_paper');
var CharacteristicWeather = require('./characteristic_weather');
var CharacteristicIp = require('./characteristic_ip');
function ShittyService(toilet) {
this.occupationChar = new CharacteristicOccupation(toilet);
this.paperChar = new CharacteristicPaper(toilet);
ShittyService.super_.call(this, {
uuid: 'ffffffffffffffffffffffffffd017ed',
characteristics: [
new CharacteristicWaterFlow(toilet),
new CharacteristicAroma(toilet),
this.occupationChar,
this.paperChar,
new CharacteristicWeather(toilet),
new CharacteristicIp(toilet)
]
});
}
util.inherits(ShittyService, PrimaryService);
ShittyService.prototype.notifyOccupation = function(occupation)
{
this.occupationChar.notifyOccupation(occupation)
}
ShittyService.prototype.notifyPaper = function(available)
{
this.paperChar.notifyPaper(available)
}
module.exports = ShittyService;