stvmallen / homebridge-roomba-stv

Homebrige plugin for Roomba 9xx
MIT License
38 stars 15 forks source link

Not an issue! #5

Closed nitaybz closed 6 years ago

nitaybz commented 6 years ago

Hey Man! I saw you just published your last version... I have to say I'm impressed how you solved the whole big status delay issue by cacheing it... great improvement and I definitely started to use it.

I was interested in knowing why you decided to delete the status when a SET command has been made, why not just changing the status to whatever the new status is set?

also I was curious, since you are keeping the status in cache, doesn't it make all the states permanent until new set command has been made? that means battery status is not really reliable... or correct me if I'm wrong.

my suggestion is to get status from the device every X minutes and update with updateValue()... that way it will not delay the "get status" command but will keep updated with the right values.

what do you think?

UPDATE: Just noticed that you are keeping the cache only for 30 seconds... so most of what I said is irrelevant :) but consider my suggestion anyway...

esteban-mallen commented 6 years ago

my suggestion is to get status from the device every X minutes and update with updateValue()... that way it will not delay the "get status" command but will keep updated with the right values.

That's something I have in mind too.

I was interested in knowing why you decided to delete the status when a SET command has been made, why not just changing the status to whatever the new status is set?

On Roomba start (i.e. setting status to ON) I choose to delete the cached status instead of just updating to a new one to force an update from the Roomba. Still... the whole setState() is something I think I'll be rewriting, I'm not 100% happy with it.

I saw you just published your last version... I have to say I'm impressed how you solved the whole big status delay issue by cacheing it... great improvement and I definitely started to use it.

Thank you so much for your comments. I'm happy you're using it and finding it helpful!

nitaybz commented 6 years ago

Great... I will follow up on your updates 👍