QuickSander / homebridge-mieleathome

Apache License 2.0
37 stars 7 forks source link

Warning: characteristic was supplied illegal value: number 1 exceeded minimum of 10 #20

Closed grzegorz914 closed 3 years ago

grzegorz914 commented 3 years ago

After update to 2.7.0

[7.03.2021, 08:42:16] [homebridge-mieleathome] This plugin generated a warning from the characteristic 'Target Temperature': characteristic was supplied illegal value: number 1 exceeded minimum of 10. See https://git.io/JtMGR for more info.

QuickSander commented 3 years ago

Acknowledged. Being discussed in the discussion forum also. I'm afraid there is no simple solution. HomeKit's minimum target temp is 10°C while we desire a range between 0 and 10°C for fridges. I'm pushing the boundaries of what HomeKit allows.

grzegorz914 commented 3 years ago

just adapt min and max value:

https://github.com/homebridge/HAP-NodeJS/blob/410f40032c21dc4bf9ffd63e00e04c7ddd3f79f2/src/lib/definitions/CharacteristicDefinitions.ts#L4143

QuickSander commented 3 years ago

The thing is that is exactly what I'm doing already since the first experimental version of Fridge support. So scratch the "just" 😉

Hence why otherwise you wouldn't have seen a temperature dial with a range from 1-9 with step size of 1°C.

QuickSander commented 3 years ago

The new version at least reduces the amount of warnings by preventing to update the characteristic each and every poll interval. I hope this helps.

grzegorz914 commented 3 years ago

Are U Try this part of code for set correct min. and max. value for Target Temperature :

accessory.getService(Service.Thermostat)
  .getCharacteristic(Characteristic.TargetTemperature)
  .setProps({
    minValue: 0,
    maxValue: 30,
    minStep: 1
  });
QuickSander commented 3 years ago

Thanks, but: yes, that is exactly the code I already had built-in since the first version. (Except with 1-9 step 1).

Hence why otherwise you wouldn't have seen a temperature dial with a range from 1-9 with step size of 1°C.

QuickSander commented 3 years ago

Is this issue still present for you with v2.7.2?

grzegorz914 commented 3 years ago

No,

The warning is gone

QuickSander commented 3 years ago

Later version returned the problem, but I have finally found the root cause. See #23.