mirror of
https://github.com/mtan93/homebridge.git
synced 2026-05-08 06:16:08 +01:00
Fix logic issue in error reporting
This commit is contained in:
@@ -17,7 +17,7 @@ TeslaAccessory.prototype = {
|
|||||||
|
|
||||||
if (powerOn) {
|
if (powerOn) {
|
||||||
tesla.auto_conditioning({id:vehicle, climate: 'start'}, function(response) {
|
tesla.auto_conditioning({id:vehicle, climate: 'start'}, function(response) {
|
||||||
if (!response.result)
|
if (response.result)
|
||||||
that.log("Started climate control.");
|
that.log("Started climate control.");
|
||||||
else
|
else
|
||||||
that.log("Error starting climate control: " + response.reason);
|
that.log("Error starting climate control: " + response.reason);
|
||||||
@@ -25,10 +25,10 @@ TeslaAccessory.prototype = {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tesla.auto_conditioning({id:vehicle, climate: 'stop'}, function(response) {
|
tesla.auto_conditioning({id:vehicle, climate: 'stop'}, function(response) {
|
||||||
if (!response.result)
|
if (response.result)
|
||||||
that.log("Stopped climate control.");
|
that.log("Stopped climate control.");
|
||||||
else
|
else
|
||||||
that.log("Error starting climate control: " + response.reason);
|
that.log("Error stopping climate control: " + response.reason);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user