[homekit] fix thermostats with auto mode and only target temperature (#17136)

allow configuring such an accessory, and it's up to the user to be okay
with how the Home app deals with it

Signed-off-by: Cody Cutrer <cody@cutrer.us>
This commit is contained in:
Cody Cutrer 2024-07-24 01:10:46 -06:00 committed by GitHub
parent 0158befacc
commit e9369b6956
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,13 +83,6 @@ class HomekitThermostatImpl extends AbstractHomekitAccessoryImpl {
var targetHeatingCoolingStateCharacteristic = getCharacteristic(TargetHeatingCoolingStateCharacteristic.class)
.get();
if (Arrays.stream(targetHeatingCoolingStateCharacteristic.getValidValues())
.anyMatch(v -> v.equals(TargetHeatingCoolingStateEnum.AUTO))
&& (!coolingThresholdTemperatureCharacteristic.isPresent()
|| !heatingThresholdTemperatureCharacteristic.isPresent())) {
throw new HomekitException(
"Both HeatingThresholdTemperature and CoolingThresholdTemperature must be provided if AUTO mode is allowed.");
}
// TargetTemperature not provided; simulate by forwarding to HeatingThresholdTemperature and
// CoolingThresholdTemperature