Skip to content

Commit

Permalink
service/upower: correctly deserialize UPowerDeviceState::Discharging
Browse files Browse the repository at this point in the history
???
  • Loading branch information
outfoxxed committed Jan 4, 2025
1 parent f3b7171 commit eaf8549
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/services/upower/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ DBusResult<qreal> DBusDataTransform<PowerPercentage>::fromWire(qreal wire) {

DBusResult<UPowerDeviceState::Enum>
DBusDataTransform<UPowerDeviceState::Enum>::fromWire(quint32 wire) {
if (wire != UPowerDeviceType::Battery && wire >= UPowerDeviceState::Unknown
&& wire <= UPowerDeviceState::PendingDischarge)
{
if (wire >= UPowerDeviceState::Unknown && wire <= UPowerDeviceState::PendingDischarge) {
return DBusResult(static_cast<UPowerDeviceState::Enum>(wire));
}

Expand Down

0 comments on commit eaf8549

Please sign in to comment.