Skip to content

Commit

Permalink
1.4.5-beta.3
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoduj committed Apr 21, 2021
1 parent ebcb1b1 commit 900421b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ You can also use the [PACKAGES](https://github.com/oznu/docker-homebridge#option

All notable changes to this project will be documented in this file.

## 1.4.5-beta.3

- [FIX] Custom areas and spots as separate device #63

## 1.4.5-beta.2

- [FIX] Custom areas and spots as separate device #63
Expand Down
32 changes: 20 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ myDeebotEcovacsPlatform.prototype = {
);

if (!HKBatteryService) {
this.log('INFO - Creating Battery Service ' + deebotName);
this.log('INFO - Creating Battery Service for ' + deebotName);
HKBatteryService = new Service.BatteryService(deebotName, 'BatteryService' + deebotName);
HKBatteryService.subtype = 'BatteryService' + deebotName;
myDeebotEcovacsAccessory.addService(HKBatteryService);
Expand All @@ -278,7 +278,7 @@ myDeebotEcovacsPlatform.prototype = {
);

if (!HKFanService) {
this.log('INFO - Creating Fan Service ' + deebotName);
this.log('INFO - Creating Fan Service for ' + deebotName);
HKFanService = new Service.Fan('Start/Pause ' + deebotName, 'FanService' + deebotName);
HKFanService.subtype = 'FanService' + deebotName;
myDeebotEcovacsAccessory.addService(HKFanService);
Expand All @@ -300,7 +300,7 @@ myDeebotEcovacsPlatform.prototype = {
);

if (!HKSwitchOnService) {
this.log('INFO - Creating Main Switch Service ' + deebotName);
this.log('INFO - Creating Main Switch Service for ' + deebotName);
HKSwitchOnService = new Service.Switch(
'Start/Stop ' + deebotName,
'SwitchOnService' + deebotName
Expand All @@ -322,7 +322,7 @@ myDeebotEcovacsPlatform.prototype = {
);

if (!HKSwitchBipService) {
this.log('INFO - Creating Sound stateless Switch Service ' + deebotName);
this.log('INFO - Creating Sound stateless Switch Service for ' + deebotName);
HKSwitchBipService = new Service.Switch(
'Bip ' + deebotName,
'SwitchBipService' + deebotName
Expand All @@ -341,7 +341,7 @@ myDeebotEcovacsPlatform.prototype = {
);

if (!HKMotionService) {
this.log('INFO - Creating Motion Service ' + deebotName);
this.log('INFO - Creating Motion Service for ' + deebotName);
HKMotionService = new Service.MotionSensor(
deebotName + ' needs attention',
'MotionService' + deebotName
Expand All @@ -361,7 +361,7 @@ myDeebotEcovacsPlatform.prototype = {
);

if (!HKSwitchAutoService) {
this.log('INFO - Creating Auto stateless Switch Service ' + deebotName);
this.log('INFO - Creating Auto stateless Switch Service for ' + deebotName);
HKSwitchAutoService = new Service.Switch(
'Auto ' + deebotName,
'SwitchAutoService' + deebotName
Expand All @@ -383,7 +383,7 @@ myDeebotEcovacsPlatform.prototype = {
);

if (!HKSwitchEdgeService) {
this.log('INFO - Creating Edge stateless Switch Service ' + deebotName);
this.log('INFO - Creating Edge stateless Switch Service for ' + deebotName);
HKSwitchEdgeService = new Service.Switch(
'Edge ' + deebotName,
'SwitchEdgeService' + deebotName
Expand All @@ -405,7 +405,7 @@ myDeebotEcovacsPlatform.prototype = {
);

if (!HKSwitchSpotService) {
this.log('INFO - Creating Spot stateless Switch Service ' + deebotName);
this.log('INFO - Creating Spot stateless Switch Service for ' + deebotName);
HKSwitchSpotService = new Service.Switch(
'Spot ' + deebotName,
'SwitchSpotService' + deebotName
Expand Down Expand Up @@ -441,7 +441,7 @@ myDeebotEcovacsPlatform.prototype = {

if (!HKSwitchSpotAreaService) {
this.log(
'INFO - Creating SpotArea ' + i + ' stateless Switch Service ' + deebotName
'INFO - Creating SpotArea ' + i + ' stateless Switch Service for ' + deebotName
);
HKSwitchSpotAreaService = new Service.Switch(
'SpotArea ' + i + ' ' + deebotName,
Expand All @@ -450,9 +450,13 @@ myDeebotEcovacsPlatform.prototype = {
HKSwitchSpotAreaService.subtype = 'SwitchSpotAreaService' + i + deebotName;
if (this.publishAreaSwitchesAsSeparateDevices) {
let uuid2 = UUIDGen.generate(deebotName + 'SpotArea ' + i);
let myDeebotEcovacsAccessory2 = this.foundAccessories.find((x) => x.UUID == uuid);
let myDeebotEcovacsAccessory2 = this.foundAccessories.find(
(x) => x.UUID == uuid2
);

if (!myDeebotEcovacsAccessory2) {
this.log('INFO - Creating SpotArea' + i + ' Accessory for ' + deebotName);

myDeebotEcovacsAccessory2 = new Accessory(deebotName + 'SpotArea ' + i, uuid2);

this.api.registerPlatformAccessories(
Expand Down Expand Up @@ -530,7 +534,7 @@ myDeebotEcovacsPlatform.prototype = {

if (!HKSwitchCustomAreaService) {
this.log(
'INFO - Creating CustomArea ' + i + ' stateless Switch Service ' + deebotName
'INFO - Creating CustomArea' + i + ' stateless Switch Service for ' + deebotName
);
HKSwitchCustomAreaService = new Service.Switch(
'CustomArea ' + i + ' ' + deebotName,
Expand All @@ -540,9 +544,13 @@ myDeebotEcovacsPlatform.prototype = {

if (this.publishAreaSwitchesAsSeparateDevices) {
let uuid2 = UUIDGen.generate(deebotName + 'CustomArea ' + i);
let myDeebotEcovacsAccessory2 = this.foundAccessories.find((x) => x.UUID == uuid);
let myDeebotEcovacsAccessory2 = this.foundAccessories.find(
(x) => x.UUID == uuid2
);

if (!myDeebotEcovacsAccessory2) {
this.log('INFO - Creating CustomArea ' + i + ' Accessory for ' + deebotName);

myDeebotEcovacsAccessory2 = new Accessory(
deebotName + 'CustomArea ' + i,
uuid2
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-deebotecovacs",
"version": "1.4.5-beta.2",
"version": "1.4.5-beta.3",
"author": "Nicolas Dujardin",
"description": "Publish your deebot ecovacs as an homekit accessory",
"main": "index.js",
Expand Down

0 comments on commit 900421b

Please sign in to comment.