wmalgadey / PyTado

Python binding for Tado web API. Pythonize your central heating!
GNU General Public License v3.0
76 stars 41 forks source link

Add setAuto() to enable auto geofencing with checks and tests #56

Closed chiefdragon closed 1 year ago

chiefdragon commented 2 years ago
  1. Add setAuto() method to change HomeState (presenceLock) to Auto
    • PyTado already has methods to set this to Home and Away, but no method to set / revert it to Auto mode.
    • This change sends a DELETE request to presencelock, as does my.tado.com.
  2. Add tests and check for auto geofencing support
    • Add check to ensure auto geofencing mode can only be enabled if it is known to be supported, i.e. ensure no issues occur for users without the Auto Assist skill.
    • Add a custom exception to handle the event something tries to set auto mode when it is not known to be supported
    • Add autoGeofencingSupported flag to track this ability and an external function for getting it
    • Add tests
  3. Bump versions
    • Update Python versions in the GitHub Build workflow to match supported versions
    • Update GitHub Build workflow to use latest action versions
    • Update PyTado version to 0.14.0
chiefdragon commented 2 years ago

Also fixes https://github.com/wmalgadey/PyTado/issues/52

chiefdragon commented 2 years ago

@mattthewclayton I've just realised you've submitted a similar PR to me. I've been sitting on it for months and only just got around to committing and PRing :-) We've implemented setAuto() pretty much the same, coincidentally. I've also added tests, as well as add checks to ensure it can't be used if the Tado Home doesn't support auto geofencing (i.e. doesn't have the Auto Assist skill). I guess if your PR is accepted, then mine can be applied over the top (or I can merge and resolve conflicts, then re-submit my PR), alternatively if mine is approved, I guess you'd only need to apply your timetabling fix. @wmalgadey - happy to help whichever way you'd prefer to apply them

mattthewclayton commented 2 years ago

I was being lazy just pushing the extra setTimetable fixes on the same PR I'll kill my PR and just make one for those fixes alone.

chiefdragon commented 2 years ago

Great, thanks