@danielgindi/homebridge-bcp-charger
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -40,2 +40,3 @@ "use strict"; | ||
maxCurrent: null, | ||
isGettingReadyToCharge: false, | ||
}; | ||
@@ -178,2 +179,3 @@ this.currentSwitches = new Map(); | ||
} | ||
let notReadyTimeout = null; | ||
chargerSwitch.getCharacteristic(this.platform.Characteristic.On) | ||
@@ -185,2 +187,9 @@ .onSet(async (v) => { | ||
this.states.charging = true; | ||
this.states.isGettingReadyToCharge = true; | ||
if (notReadyTimeout) { | ||
clearTimeout(notReadyTimeout); | ||
} | ||
notReadyTimeout = setTimeout(() => { | ||
this.states.isGettingReadyToCharge = false; | ||
}, 15000); | ||
chargerSwitch.updateCharacteristic(this.platform.Characteristic.On, 1); | ||
@@ -191,2 +200,6 @@ } | ||
this.states.charging = false; | ||
this.states.isGettingReadyToCharge = false; | ||
if (notReadyTimeout) { | ||
clearTimeout(notReadyTimeout); | ||
} | ||
chargerSwitch.updateCharacteristic(this.platform.Characteristic.On, 0); | ||
@@ -217,3 +230,4 @@ } | ||
data.state === ChargerState.NotReady; | ||
this.states.charging = data.state === ChargerState.Charging; | ||
this.states.charging = data.state === ChargerState.Charging || | ||
(data.state === ChargerState.NotReady && this.states.isGettingReadyToCharge); | ||
this.states.maxCurrent = (_a = data.maxCurrent) !== null && _a !== void 0 ? _a : null; | ||
@@ -220,0 +234,0 @@ pluggedContactSensor.updateCharacteristic(this.platform.Characteristic.ContactSensorState, this.states.plugged ? pluggedStateForPlugged : pluggedStateForUnplugged); |
{ | ||
"displayName": "BCP EV Charger (Z-Box compatible)", | ||
"name": "@danielgindi/homebridge-bcp-charger", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "A homebridge plugin controlling the BCP EV chargers (Z-Box compatible chargers)", | ||
@@ -39,5 +39,5 @@ "license": "MIT", | ||
"@types/node": "^14.18.33", | ||
"@typescript-eslint/eslint-plugin": "^5.42.0", | ||
"@typescript-eslint/parser": "^5.42.0", | ||
"eslint": "^8.27.0", | ||
"@typescript-eslint/eslint-plugin": "^5.44.0", | ||
"@typescript-eslint/parser": "^5.44.0", | ||
"eslint": "^8.28.0", | ||
"homebridge": "^1.5.1", | ||
@@ -47,4 +47,4 @@ "nodemon": "^2.0.20", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.8.4" | ||
"typescript": "^4.9.3" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61851
663