Skip to content
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

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

Megabytemb
Copy link
Contributor

This adds abstractions and the adjust volume endpoint

def safeget(dct, *keys, default=None):
"""Get a recursuive object from a dict."""
for key in keys:
try:
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

teslajsonpy/car.py Outdated Show resolved Hide resolved
@alandtse
Copy link
Collaborator

Just to confirm, did you still want to do this?

@alandtse
Copy link
Collaborator

Btw, I'm not sure why this touches every file in the repo. This will really muddle history. Can you figure out why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants