homebridge-cool-automation
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -12,3 +12,3 @@ const AirConditioner = require('../homekit/AirConditioner') | ||
const airConditionerIsNew = !platform.activeAccessories.find(accessory => accessory.type === 'AirConditioner' && accessory.id === device.uid) | ||
if (airConditionerIsNew) { | ||
if (airConditionerIsNew && device.uid !== 'OK') { | ||
const airConditioner = new AirConditioner(device, platform) | ||
@@ -22,37 +22,40 @@ platform.activeAccessories.push(airConditioner) | ||
// find devices to remove | ||
// const accessoriesToRemove = [] | ||
// platform.cachedAccessories.forEach(accessory => { | ||
const accessoriesToRemove = [] | ||
platform.cachedAccessories.forEach(accessory => { | ||
// if (!accessory.context.type) { | ||
// accessoriesToRemove.push(accessory) | ||
// platform.log.easyDebug('removing old cached accessory') | ||
// } | ||
// if (!accessory.context.type) { | ||
// accessoriesToRemove.push(accessory) | ||
// platform.log.easyDebug('removing old cached accessory') | ||
// } | ||
// let deviceExists | ||
// switch(accessory.context.type) { | ||
// case 'AirConditioner': | ||
// deviceExists = platform.devices.find(device => device.uid === accessory.context.deviceId) | ||
// if (!deviceExists) | ||
// accessoriesToRemove.push(accessory) | ||
// break | ||
// default: | ||
// accessoriesToRemove.push(accessory) | ||
// break | ||
// } | ||
// }) | ||
// let deviceExists | ||
// switch(accessory.context.type) { | ||
// case 'AirConditioner': | ||
// deviceExists = platform.devices.find(device => device.uid === accessory.context.deviceId) | ||
// if (!deviceExists) | ||
// accessoriesToRemove.push(accessory) | ||
// break | ||
// default: | ||
// accessoriesToRemove.push(accessory) | ||
// break | ||
// } | ||
// if (accessoriesToRemove.length) { | ||
// platform.log.easyDebug('Unregistering Unnecessary Cached Devices:') | ||
// platform.log.easyDebug(accessoriesToRemove) | ||
if (accessory.displayName === 'OK AC' || accessory.name === 'OK AC' || accessory.displayName === 'OK') | ||
accessoriesToRemove.push(accessory) | ||
}) | ||
// // unregistering accessories | ||
// platform.api.unregisterPlatformAccessories(platform.PLUGIN_NAME, platform.PLATFORM_NAME, accessoriesToRemove) | ||
if (accessoriesToRemove.length) { | ||
platform.log.easyDebug('Unregistering Unnecessary Cached Devices:') | ||
platform.log.easyDebug(accessoriesToRemove) | ||
// // remove from cachedAccessories | ||
// platform.cachedAccessories = platform.cachedAccessories.filter( cachedAccessory => !accessoriesToRemove.find(accessory => accessory.UUID === cachedAccessory.UUID) ) | ||
// unregistering accessories | ||
platform.api.unregisterPlatformAccessories(platform.PLUGIN_NAME, platform.PLATFORM_NAME, accessoriesToRemove) | ||
// // remove from activeAccessories | ||
// platform.activeAccessories = platform.activeAccessories.filter( activeAccessory => !accessoriesToRemove.find(accessory => accessory.UUID === activeAccessory.UUID) ) | ||
// } | ||
// remove from cachedAccessories | ||
platform.cachedAccessories = platform.cachedAccessories.filter( cachedAccessory => !accessoriesToRemove.find(accessory => accessory.UUID === cachedAccessory.UUID) ) | ||
// remove from activeAccessories | ||
platform.activeAccessories = platform.activeAccessories.filter( activeAccessory => !accessoriesToRemove.find(accessory => accessory.UUID === activeAccessory.UUID) ) | ||
} | ||
} | ||
} |
{ | ||
"name": "homebridge-cool-automation", | ||
"description": "Homebridge plugin for Cool Automation - HVAC Systems Controller", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"repository": { | ||
@@ -27,4 +27,3 @@ "type": "git", | ||
"dependencies": { | ||
"node-persist": "^3.1.3", | ||
"tcp-client": "^1.1.9" | ||
"node-persist": "^3.1.3" | ||
}, | ||
@@ -36,3 +35,4 @@ "devDependencies": { | ||
"lint": "eslint .", | ||
"lint:fix": "eslint . --fix" | ||
"lint:fix": "eslint . --fix", | ||
"test": "" | ||
}, | ||
@@ -39,0 +39,0 @@ "funding": [ |
@@ -8,5 +8,4 @@ <img src="branding/coolautomation_homebridge.png" width="500px"> | ||
[![Downloads](https://img.shields.io/npm/dt/homebridge-cool-automation.svg?color=critical)](https://www.npmjs.com/package/homebridge-cool-automation) | ||
[![Version](https://img.shields.io/npm/v/homebridge-cool-automation)](https://www.npmjs.com/package/homebridge-cool-automation)<br> | ||
<!-- [![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins) [![Homebridge Discord](https://img.shields.io/discord/432663330281226270?color=728ED5&logo=discord&label=discord)](https://discord.gg/ZX3wSZpXaP)<br> | ||
[![certified-hoobs-plugin](https://badgen.net/badge/HOOBS/Certified/yellow)](https://plugins.hoobs.org?ref=10876) [![hoobs-support](https://badgen.net/badge/HOOBS/Support/yellow)](https://support.hoobs.org?ref=10876) --> | ||
[![Version](https://img.shields.io/npm/v/homebridge-cool-automation)](https://www.npmjs.com/package/homebridge-cool-automation) | ||
[![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins) | ||
@@ -13,0 +12,0 @@ |
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
1
1298
266577
1
122
- Removedtcp-client@^1.1.9
- Removedasync@2.6.4(transitive)
- Removedcolors@1.0.3(transitive)
- Removedcycle@1.0.3(transitive)
- Removedeyes@0.1.8(transitive)
- Removedisstream@0.1.2(transitive)
- Removedlodash@4.17.21(transitive)
- Removedmoment@2.30.1(transitive)
- Removedstack-trace@0.0.10(transitive)
- Removedtcp-client@1.1.9(transitive)
- Removedwinston@2.4.7(transitive)