Fixed #61 Warnings in homebridge 1.3 because of illegal characteristic values

This commit is contained in:
Arne Blumentritt 2021-04-25 19:35:34 +02:00 committed by Luis Riegger
parent b9e0e64390
commit 16140dc71e

View File

@ -516,7 +516,7 @@ KoboldVacuumRobotAccessory.prototype = {
getSpotClean: function (callback) getSpotClean: function (callback)
{ {
callback(); callback(false, this.spotCleanService.getCharacteristic(Characteristic.On).value);
}, },
setSpotClean: function (on, callback) setSpotClean: function (on, callback)
@ -674,8 +674,13 @@ KoboldVacuumRobotAccessory.prototype = {
if (this.spotPlusFeatures) if (this.spotPlusFeatures)
{ {
this.spotCleanService.setCharacteristic(SpotWidthCharacteristic, this.robot.spotWidth); let widthProps = this.spotCleanService.getCharacteristic(SpotWidthCharacteristic).props;
this.spotCleanService.setCharacteristic(SpotHeightCharacteristic, this.robot.spotHeight); let heightProps = this.spotCleanService.getCharacteristic(SpotHeightCharacteristic).props;
this.spotCleanService.setCharacteristic(SpotWidthCharacteristic,
this.robot.spotWidth >= widthProps.minValue && this.robot.spotWidth <= widthProps.maxValue ? this.robot.spotWidth : widthProps.minValue);
this.spotCleanService.setCharacteristic(SpotHeightCharacteristic,
this.robot.spotHeight >= heightProps.minValue && this.robot.spotHeight <= heightProps.maxValue ? this.robot.spotHeight : heightProps.minValue);
} }
} }