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: handle sleep behavior of MCU2 upgraded cars #4453

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JakobLichterfeld
Copy link
Collaborator

changes from @micves from #3262, fixes #3084

@JakobLichterfeld JakobLichterfeld added enhancement New feature or request area:tesla api Related to the Tesla API area:teslamate Related to TeslaMate core labels Dec 23, 2024
Copy link

netlify bot commented Dec 23, 2024

Deploy Preview for teslamate ready!

Name Link
🔨 Latest commit f951d44
🔍 Latest deploy log https://app.netlify.com/sites/teslamate/deploys/6777abd3c9d70a00084419eb
😎 Deploy Preview https://deploy-preview-4453--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.

@JakobLichterfeld JakobLichterfeld marked this pull request as draft December 23, 2024 12:25
@JakobLichterfeld JakobLichterfeld added note:help wanted Extra attention is needed note:needs investigation The issue must be investigated first labels Dec 23, 2024
@brianmay
Copy link
Collaborator

brianmay commented Jan 2, 2025

I am having trouble making sense of this PR.

It started off simple (with the original first two commits from the first PR) and has become rather complicated, and IMHO hard to understand. And I am wondering if this complexity is really required.

Then there are some changes when in this PR that don't belong here; for example the changes to delete the "models2" entries. I think this might have been included in error.

There are some changes though that would be easy to apply separately, for example improvements to the log messages.

@JakobLichterfeld
Copy link
Collaborator Author

Agree, I do have trouble reviewing. The comments helped a bit.
As so much test cases fail I would love to see a split up by @micves on this branch.

@brianmay brianmay force-pushed the mcu2-upgraded-cars branch from d2999d2 to f951d44 Compare January 3, 2025 09:20
@micves
Copy link
Contributor

micves commented Jan 3, 2025

Not sure where the model2 changes are coming from. They are not in the original https://github.com/teslamate-org/teslamate/pull/3262/files Maybe it wasn't synced when this PR was made?

The commit history of the old #3262 is long and a bit messed up. Might be easier to only look at the end result. Which again as you mention is a bit complex :(
The issue is also complex as the length of #3084 also indicates.

The shortest way to sum it up, might actually just be the description I made on fake_online_state variable:

fake_online_state is introduced because older cars upgraded to MCU2 have a little wakeup every hour to check subsystems.
They report online but if vehicle_data is requested they wake up completely (cars clicks) and is awake for
15 minutes instead of a 2-3 minutes. The only difference (known at this moment) is that stream reports power=nil
in subsystem online and reports power as a number when it is a real online.

The complexity comes in because online all of a sudden might not be online.
It's Schrödinger's online until data from Stream is received :)

This means that the entire online state handling and stream is re-done, and the tests (or as I see it, the API mock used for tests) does not support the fact that a Stream is required.

The ultimate solution would be that the car or Tesla servers would hide the fake online.
I haven't checked in a while, but my guess is that nothing has changed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:tesla api Related to the Tesla API area:teslamate Related to TeslaMate core enhancement New feature or request note:help wanted Extra attention is needed note:needs investigation The issue must be investigated first
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing sleep state, long wake times and errors in log with MCU2 updated cars
3 participants