Chouffy / home_assistant_tgtg

TooGoodToGo items stock as sensor in Home Assistant
MIT License
65 stars 18 forks source link

Implement the ability to dynamically disable the sensor (preferably with a rate) #119

Open skinkie opened 3 months ago

skinkie commented 3 months ago

Checklist

Is your feature request related to a problem? Please describe.

Sometimes I don't need TGTG to be active, why keep polling. Sometimes I would like to poll it more frequently.

Describe the solution you'd like

I would like to have the ability to set the polling to a very high or a lower interval. On the sensor configuration something like a slider that I can set with an automation.

Describe alternatives you've considered

Updating the config and manually restarting and

Additional context

None.

blowk commented 2 months ago

If there is a service to call tgtg to update this would allow to change the polling through automatisation.

Is this duplicated to the question https://github.com/Chouffy/home_assistant_tgtg/issues/34 ?

skinkie commented 2 months ago

I think it is different, I would like to change an internal variable, for that it needs to be exposed.

blowk commented 2 months ago

Sorry, I don't quite understand. Do you want to change/update each sensor by own chosen interval like fir example you could stop polling during the night?

skinkie commented 2 months ago

Exactly. But the interval now is also 'choosen' but it is hardcoded in the configuration file. So what needs to be available is to be able to update it, without restarting home assistant