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: India region support #499

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

gowthamgowtham
Copy link

Works for India region. I haven't managed to add new tests. I am sure some cleanup will be necessary.

@cdnninja
Copy link
Collaborator

Thanks for doing this! I'll run through feedback this weekend. Are you able to cleanup merge conflicts and potentially rebase? It shows a lot of changes that may not be real. It will help with review.

Version commit also needs to be backed out. The system does that.

india.py Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should either:

  1. Removed.
  2. Moved to the test folders and we load your creds into a secret in the repo so these tests are run like EU. No pressure though.

@@ -45,7 +57,15 @@ class DayTripInfo:
"""Day Trip Info"""

yyyymmdd: str = None
summary: TripInfo = None
Copy link
Collaborator

Choose a reason for hiding this comment

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

Be removing this it will break other regions. I also think adding the below will break other regions. Can we conform to existing?

@@ -11,16 +12,27 @@
_LOGGER = logging.getLogger(__name__)


@dataclass
Copy link
Collaborator

Choose a reason for hiding this comment

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

Location is already handled and used in other values. No need for a new class.

@@ -1,5 +1,6 @@
# pylint:disable=missing-class-docstring,missing-function-docstring,wildcard-import,unused-wildcard-import,invalid-name
"""Vehicle class"""
import decimal
Copy link
Collaborator

Choose a reason for hiding this comment

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

We use floats.

@dataclass
class TripInfo:
"""Trip Info"""

hhmmss: str = None # will not be filled by summary
Copy link
Collaborator

Choose a reason for hiding this comment

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

Removing fields will break other regions and not work for kia_uvo. Please try to use the existing fields if possible.

self._update_vehicle_properties(vehicle, state)
state = self._get_maintenance_alert(token, vehicle)
self._update_vehicle_maintenance_alert(vehicle, state)
state = self._get_location(token, vehicle)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs protective logic. By doing this in a cached call you will kill the vehicle battery. Cached calls shouldn't hit the car each call.

@cdnninja cdnninja changed the title Updates for India region feat: India region support Feb 10, 2024

def force_refresh_vehicle_state(self, token: Token, vehicle: Vehicle) -> None:
# FIXME: Gowtham - No force refresh
_LOGGER.error(f"Disabling force refresh")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add domain like other logging to clarify what is throwing this. I assume this exists since force refresh command doesn't work yet?

@CodeWithShreyans
Copy link

any updates on this?

@nishant713
Copy link

Hi @gowthamgowtham any update?

@ohuc
Copy link

ohuc commented Jul 21, 2024

any updates

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.

5 participants