UbhiTS / ad-autofanspeed

Automatically control a room fan's speed based on a temperature sensor. Please :star: if you like this app :)
https://www.youtube.com/c/ubhits
Apache License 2.0
18 stars 6 forks source link

When temperature changes at the same moment of end time the fan never turns off #1

Closed haberda closed 4 years ago

haberda commented 4 years ago

Hello, I noticed that if the home temperature is changing when the end time occurs there seems to be a battle of the callbacks and usually the temperature change callback wins. The result is the fan never turns off. I suggest you save your callback to a variable so when end time comes you can call self.cancel_timer and cancel the callback before calling fan/turn_off.

I can do a pull request later if you want or if you can fix it that's great too.

Great app!

UbhiTS commented 4 years ago

I'm not sure that the likelihood of the temperature changing exactly at the shut off time is very realistic as the shut off happens exactly at the hour, minute and second that you define in the config. Can you please tell me exactly your use case. What and when do you see this happening and your config values.

UbhiTS commented 4 years ago

closing due to no response