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: optimize state transitions #4473

Merged
merged 3 commits into from
Jan 6, 2025
Merged

feat: optimize state transitions #4473

merged 3 commits into from
Jan 6, 2025

Conversation

brianmay
Copy link
Collaborator

@brianmay brianmay commented Jan 5, 2025

Note there are three distinct changes, each one is a separate commit.

  1. Don't enter "trying to sleep" when power > 0.
  2. Cancel an ongoing suspended state/trying to sleep if power > 0.
  3. Add conditions for entering charging mode.

power > 0 is when e.g. the climate is on which could be scheduled
preconditioning or starting preheat from the app.

This code will make sure it doesn't enter 'trying to sleep' (the internal state
suspended) when power > 0.

changes from @micves from #3262
Copy link

netlify bot commented Jan 5, 2025

Deploy Preview for teslamate ready!

Name Link
🔨 Latest commit acfb3c0
🔍 Latest deploy log https://app.netlify.com/sites/teslamate/deploys/6779f19b31ac8c00088b512f
😎 Deploy Preview https://deploy-preview-4473--teslamate.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@brianmay
Copy link
Collaborator Author

brianmay commented Jan 5, 2025

Tests pass on my box :-)

Hope I have read @micves comments on this correctly. #4453 (comment)

…o online

When power > 0.

power > 0 is when e.g. the climate is on which could be scheduled preconditioning or starting preheat from the app.

changes from @micves from #3262
Only goes to Charging when the car is plugged in (power < 0) and its not preconditioning or in dog mode.

changes from @micves from #3262
@brianmay
Copy link
Collaborator Author

brianmay commented Jan 5, 2025

This was split on from #4453

@JakobLichterfeld JakobLichterfeld added enhancement New feature or request area:teslamate Related to TeslaMate core labels Jan 6, 2025
Copy link
Collaborator

@JakobLichterfeld JakobLichterfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.
I love how you fillet big changes into small happens

@JakobLichterfeld
Copy link
Collaborator

@micves May I ask you to review as well?

@JakobLichterfeld JakobLichterfeld changed the title optimize state transitions feat: optimize state transitions Jan 6, 2025
@micves
Copy link
Contributor

micves commented Jan 6, 2025

Hope I have read @micves comments on this correctly. #4453 (comment)

Nice work, its spot on :)

@micves May I ask you to review as well?

Yes, lgtm and approved 👍

@brianmay
Copy link
Collaborator Author

brianmay commented Jan 6, 2025

I love how you fillet big changes into small happens

Have been looking at Jujutsu, which makes this sort a log easier then plan git.

There is a lot of youtube videos, blogs, etc on jujutsu, mostly positive opinions. Home page is https://jj-vcs.github.io/jj/latest/

There is a learning curve though. It does some fundamental things very differently to git, which is very likely to catch you by surprise if you are use to git (apparently these come from Mercurial).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:teslamate Related to TeslaMate core enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants