ardevd / jlrpy

Python library for interacting with the JLR Remote Car API
MIT License
85 stars 28 forks source link

Modern code standards and new functions #106

Closed msp1974 closed 12 months ago

msp1974 commented 1 year ago

@ardevd hope you are well. I am back deveoping and supporting the JLR integration for Home Assistant, utilising your great api here. As I have been working through updating it to better function with current HA, I have done a little rework on the code to update it to modern python standards and added some new functions. Hope this is ok and you can merge. Let me know if any issues. Changes as below.

  1. Move to requests library
  2. Used enum classes for server endpoints instead of global variables
  3. Refactored strings to use f-string
  4. Added waua status
  5. Added disable guardian mode
  6. Added disable service mode
  7. Added disable transport mode

Appreciate a number of changes but if you could look at this for me as I want to issue a new HA integration version out to the user community and need to the new disable functions as part of that.

Thanks & kind regards, Mark

ardevd commented 12 months ago

Really appreciate the contribution. I'll review it asap.

ardevd commented 12 months ago

@msp1974 a few notes:

requests.exceptions.MissingSchema: Invalid URL 'BaseURLs.IFAS/tokens': No scheme supplied. Perhaps you meant https://BaseURLs.IFAS/tokens?

msp1974 commented 12 months ago

Let me look at that as was working fine when tested.

msp1974 commented 12 months ago

I have no clue what I did there....must stop drinking!!

Have made just an object class instead of enum and all tested as expected. Also added requirements.txt and install_requires in setup.py.

ardevd commented 12 months ago

Thank you again very much for your contribution.