iRayanKhan / homebridge-tuya

A Homebridge plugin to control Tuya devices locally.
MIT License
395 stars 165 forks source link

SimpleHeater: use IDLE state to properly show up in HomeKit, add offset for currentTemperature, fix targetTemperatureDivisor #468

Open lisanet opened 4 months ago

lisanet commented 4 months ago

SimpleHeater:

a) doesn't properly reflect the state of the Heater, because it only uses HEATING and INACTIVE. If a Heater is above its target temerature, the heater ist still active, but in IDLE mode.

b) Temparature measurement of a heater may be off by some amount. Adding an offset will fix this

c) In SimpleHeater there's no need for targetTemperatureDivisor. Instead _getDividedState() is the way to do. This fixes #467. Further _getDividedState() is used an essential for the temperature offset.

This PR adds these three issues.