-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add media controls #406
base: dev
Are you sure you want to change the base?
Conversation
teslajsonpy/car.py
Outdated
def safeget(dct, *keys, default=None): | ||
"""Get a recursuive object from a dict.""" | ||
for key in keys: | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use dict.get?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't use get, otherwise we end up with .get(...).get(...).get(....)
and it can get quite long and messy.
This little helper function cleans that up.
If you're happy with it, in a later pull request, i can update all the others to use the helper function.
Just to confirm, did you still want to do this? |
65ca349
to
cdcd5d9
Compare
Btw, I'm not sure why this touches every file in the repo. This will really muddle history. Can you figure out why? |
This adds abstractions and the adjust volume endpoint