Skip to content

Commit 94457ce

Browse files
authored
Merge pull request #1 from ptweety/rm-homekit-dev-1
Dependencies update, linting and fix for deprecations
2 parents d5b86ff + 1eab7e8 commit 94457ce

File tree

252 files changed

+984
-1365
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+984
-1365
lines changed

create-todo.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ const fs = require('fs');
22

33
const dir = fs.readdirSync('./homematic-devices');
44

5-
dir.forEach(file => {
6-
if (file.match(/h.*-.*\.js/)) {
7-
const len = fs.readFileSync('./homematic-devices/' + file).toString().split('\n').length;
8-
if (len > 4) {
5+
for (const file of dir) {
6+
if (/h.*-.*\.js/.test(file)) {
7+
const {length} = fs.readFileSync('./homematic-devices/' + file).toString().split('\n');
8+
if (length > 4) {
99
console.log('- [ ] ' + file.replace('.js', ''));
1010
}
1111
}
12-
});
12+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('./hm-lc-bl1pbu-fm');
1+
module.exports = require('./hm-lc-bl1pbu-fm.js');
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('./lib/generic-switch');
1+
module.exports = require('./lib/generic-switch.js');

homematic-devices/hb-lc-sw2-fm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('./lib/generic-switch');
1+
module.exports = require('./lib/generic-switch.js');
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('./lib/generic-switch');
1+
module.exports = require('./lib/generic-switch.js');

homematic-devices/hb-uni-dmx-master.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Accessory = require('./lib/accessory');
1+
const Accessory = require('./lib/accessory.js');
22

33
module.exports = class HmUniDmx extends Accessory {
44
init(config, node) {
@@ -13,9 +13,7 @@ module.exports = class HmUniDmx extends Accessory {
1313
const ch = config.description.ADDRESS + ':' + i;
1414
const service = this.addService('Switch', ccu.channelNames[ch]);
1515

16-
service.get('On', () => {
17-
return false;
18-
});
16+
service.get('On', () => false);
1917
service.set('On', (value, callback) => {
2018
if (value) {
2119
ccu.setValue(config.iface, ch, 'PRESS_SHORT', true)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('./hm-lc-rgbw-wm');
1+
module.exports = require('./hm-lc-rgbw-wm.js');
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
const Accessory = require('./lib/accessory');
1+
const Accessory = require('./lib/accessory.js');
22

33
module.exports = class HbUniSenPress extends Accessory {
44
init(config) {
55
this.addService('ContactSensor', config.name)
6-
.get('ContactSensorState', config.deviceAddress + ':2.STATE', (value, c) => {
7-
return value ? c.CONTACT_NOT_DETECTED : c.CONTACT_DETECTED;
8-
})
6+
.get('ContactSensorState', config.deviceAddress + ':2.STATE', (value, c) => value ? c.CONTACT_NOT_DETECTED : c.CONTACT_DETECTED)
97

10-
.get('StatusLowBattery', config.deviceAddress + ':0.LOWBAT', (value, c) => {
11-
return value ? c.BATTERY_LEVEL_LOW : c.BATTERY_LEVEL_NORMAL;
12-
});
8+
.get('StatusLowBattery', config.deviceAddress + ':0.LOWBAT', (value, c) => value ? c.BATTERY_LEVEL_LOW : c.BATTERY_LEVEL_NORMAL);
139
}
1410
};

homematic-devices/hb-uni-sen-temp-ds18b20.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
const Accessory = require('./lib/accessory');
1+
const Accessory = require('./lib/accessory.js');
22

3+
// eslint-disable-next-line unicorn/prevent-abbreviations
34
module.exports = class HbUniSenTemp extends Accessory {
45
init(config, node) {
56
const {ccu} = node;
@@ -17,9 +18,7 @@ module.exports = class HbUniSenTemp extends Accessory {
1718
this.addService('TemperatureSensor', name)
1819
.setProps('CurrentTemperature', {minValue: -150, maxValue: 150})
1920
.get('CurrentTemperature', dp)
20-
.get('StatusLowBattery', config.deviceAddress + ':0.LOWBAT', (value, c) => {
21-
return value ? c.BATTERY_LEVEL_LOW : c.BATTERY_LEVEL_NORMAL;
22-
});
21+
.get('StatusLowBattery', config.deviceAddress + ':0.LOWBAT', (value, c) => value ? c.BATTERY_LEVEL_LOW : c.BATTERY_LEVEL_NORMAL);
2322
}
2423
}
2524
};

homematic-devices/hb-uni-sen-temp-ir.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
const Accessory = require('./lib/accessory');
1+
const Accessory = require('./lib/accessory.js');
22

3+
// eslint-disable-next-line unicorn/prevent-abbreviations
34
module.exports = class HbUniSenTemp extends Accessory {
45
init(config, node) {
56
const {ccu} = node;
@@ -18,9 +19,7 @@ module.exports = class HbUniSenTemp extends Accessory {
1819
this.addService('TemperatureSensor', name)
1920
.setProps('CurrentTemperature', {minValue: -450, maxValue: 450})
2021
.get('CurrentTemperature', dp)
21-
.get('StatusLowBattery', config.deviceAddress + ':0.LOWBAT', (value, c) => {
22-
return value ? c.BATTERY_LEVEL_LOW : c.BATTERY_LEVEL_NORMAL;
23-
});
22+
.get('StatusLowBattery', config.deviceAddress + ':0.LOWBAT', (value, c) => value ? c.BATTERY_LEVEL_LOW : c.BATTERY_LEVEL_NORMAL);
2423
}
2524
}
2625
};

0 commit comments

Comments
 (0)