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

[battery] Allow to control charging hysteresis. JB#58372 #29

Merged
merged 1 commit into from Oct 21, 2022
Merged

Conversation

martyone
Copy link
Member

No description provided.

@martyone martyone requested a review from spiiroin July 20, 2022 12:44
Copy link
Member

@vigejolla vigejolla left a comment

Choose a reason for hiding this comment

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

LGTM

@martyone martyone force-pushed the jb58372 branch 2 times, most recently from bfb3c75 to 47a3e7e Compare August 22, 2022 10:51
@martyone
Copy link
Member Author

martyone commented Aug 22, 2022

Refactored to use MCE's settings API. The diff to look at is ff4f4e3..47a3e7e.

@martyone
Copy link
Member Author

Refactored the write side too, fixed D-Bus signal handling.

@martyone
Copy link
Member Author

Updated after dropping change to enum ordering on mce side.

src/batterystatus.cpp Outdated Show resolved Hide resolved
Unlike MCE, here we use the natural ordering for the ChargingMode enum,
using first item for the default value (EnableCharging).

Signed-off-by: Martin Kampas <martin.kampas@jolla.com>
Copy link
Contributor

@spiiroin spiiroin left a comment

Choose a reason for hiding this comment

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

No real issues with what is already here, but that charge-full-once and/or charge-full-after-connect discussion would affect what is needed here -> I'd like to see that resolved 1st.

@@ -59,6 +73,18 @@ BatteryStatusPrivate::BatteryStatusPrivate(BatteryStatus *batteryInfo)
registerSignals();

// read initial values
NemoDBus::Response *chargingMode = m_mceInterface.call(MCE_CONFIG_GET,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we have had problems with exceeding max number of pending method calls during startup of some processes, and this 3 x { MCE_CONFIG_GET } could be handled via 1 x { MCE_CONFIG_GET_ALL }. For ref see displaysettings.cpp
...

switch (mode) {
default:
case BatteryStatus::EnableCharging:
return MceChargingModeEnable;
Copy link
Contributor

Choose a reason for hiding this comment

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

consistency nit: return from default: here vs. return from outside switch in the above function. Both ways are just fine, but now there are two very similar methods that look different. Feel free to ignore ;-)

@spiiroin spiiroin merged commit a5edeb4 into master Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants