goedh452 / homebridge-http-sprinkler

Homebridge http controlled sprinkler
Apache License 2.0
12 stars 6 forks source link

RemainingDuration not being updated #5

Closed royby12 closed 2 years ago

royby12 commented 6 years ago

Hi again :)

I've been trying to play around with the duration and find out that RemainingDuration is not being updated during the countdown.

For the "once" state you can just add right after line 154 something like: this.valveService.getCharacteristic(Characteristic.RemainingDuration).updateValue(timeLeft);

Assuming you have the value for how much time is left. I'm not sure how it should be done for the Polling option though.

PS - I've been playing around and put: this.valveService.getCharacteristic(Characteristic.RemainingDuration).updateValue(100); In the GetPowerState function of your while using "Once" state. The time in the home app was always updated now to 1:40 min every time I opened the app but it was still turned off after the SetDuration time (5 min).