Skip to content

Add AC Current Limit functions#17

Merged
nshp merged 1 commit intomainfrom
joec/setAcCurrent
Oct 7, 2025
Merged

Add AC Current Limit functions#17
nshp merged 1 commit intomainfrom
joec/setAcCurrent

Conversation

@jcieplinski
Copy link
Copy Markdown
Collaborator

  • Added set_ac_current_limit
  • Added get_ac_current_settings, in case you want to poll for the current settings
  • Added an example file

@jcieplinski jcieplinski requested a review from Copilot August 19, 2025 20:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds AC current limit control functionality to the LucidAPI, allowing users to programmatically set and retrieve AC charging current limits for Lucid vehicles.

  • Adds set_ac_current_limit() method to control the AC current limit for charging
  • Adds get_ac_current_settings() method to retrieve current AC current settings
  • Includes a comprehensive example script demonstrating the new functionality

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
lucidmotors/__init__.py Adds two new methods to the LucidAPI class for AC current limit control and monitoring
examples/ac_current_control.py Provides a complete example script demonstrating how to use the new AC current control features

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread lucidmotors/__init__.py
self._vehicle_service.SetCreatureComfortMode(request)
)

async def set_ac_current_limit(self, vehicle: Vehicle, current_limit: int) -> None:
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

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

The current_limit parameter lacks validation for reasonable AC current values. Consider adding validation to ensure the current_limit is within a safe and practical range (e.g., 6-80 amperes) to prevent potentially dangerous or invalid values from being sent to the vehicle.

Copilot uses AI. Check for mistakes.
Comment thread lucidmotors/__init__.py
Comment thread examples/ac_current_control.py
@jcieplinski jcieplinski force-pushed the joec/setAcCurrent branch 4 times, most recently from ca3f4aa to dffc723 Compare August 19, 2025 20:52
- Added set_ac_current_limit
- Added get_ac_current_settings, in case you want to poll for the current settings
- Added an example file
@nshp nshp merged commit 554ee67 into main Oct 7, 2025
2 checks passed
@beavis9k
Copy link
Copy Markdown

I'm not able to update the current limit on my 2023 AT with this - it stays at whatever is set from the pilot panel. I've tried while my car is sleeping, awake, and actively charging. Has someone else been able to set it successfully?

Here is my output from running the example:

INFO:__main__:Login successful!
INFO:__main__:Using vehicle: 641dc90828c549e26986bc81
INFO:__main__:Getting current AC current settings...
INFO:__main__:Current AC Current Settings:
INFO:__main__:  Active Session Limit: 10A
INFO:__main__:  Energy Limit: 80A
INFO:__main__:  Requested Limit: 0A
INFO:__main__:Setting AC current limit to 32A...
INFO:__main__:AC current limit set successfully!
INFO:__main__:Getting updated AC current settings...
INFO:__main__:Updated AC Current Settings:
INFO:__main__:  Active Session Limit: 10A
INFO:__main__:  Energy Limit: 80A
INFO:__main__:  Requested Limit: 0A
INFO:__main__:Setting AC current limit to 16A...
INFO:__main__:AC current limit set successfully!
INFO:__main__:Final AC Current Settings:
INFO:__main__:  Active Session Limit: 10A
INFO:__main__:  Energy Limit: 80A
INFO:__main__:  Requested Limit: 0A

@jcieplinski
Copy link
Copy Markdown
Collaborator Author

Doesn't work for me, either. Doesn't throw any error. Just doesn't have any effect in the car, either.

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.

4 participants