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

fix(linux/input): battery values conversion #2715

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

ABeltramo
Copy link
Contributor

Description

A quick fix after this report #2606 (comment)

What is happening there is that the Moonlight Switch client doesn't support battery, in absence of a value the virtual pad state defaults to 0 which causes the pad to be seen with 0% battery.

I've done two things:

  • set the default in inputtino to be CHARGED/100% so that we avoid annoying notifications for clients that don't report that value
  • adjusted the battery raw values, Moonlight sends them in the range [0, 255] whilst inputtino expects a percentage value [0, 100]

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

@ReenigneArcher ReenigneArcher enabled auto-merge (squash) June 17, 2024 22:05
@ReenigneArcher ReenigneArcher changed the title fix: battery values conversion fix(linux/input): battery values conversion Jun 17, 2024
@ReenigneArcher ReenigneArcher enabled auto-merge (squash) June 17, 2024 22:07
Copy link

codecov bot commented Jun 17, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 6.47%. Comparing base (0c0b4c4) to head (c0c482e).
Report is 148 commits behind head on master.

Files with missing lines Patch % Lines
src/platform/linux/input/inputtino_gamepad.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #2715      +/-   ##
=========================================
- Coverage    8.73%   6.47%   -2.27%     
=========================================
  Files          94      84      -10     
  Lines       17373   15897    -1476     
  Branches     8251    7645     -606     
=========================================
- Hits         1518    1029     -489     
+ Misses      12995   12283     -712     
+ Partials     2860    2585     -275     
Flag Coverage Δ
Linux 6.79% <0.00%> (+0.29%) ⬆️
Windows 4.16% <ø> (+0.33%) ⬆️
macOS-12 ?
macOS-13 ?
macOS-14 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/platform/linux/input/inputtino_gamepad.cpp 2.66% <0.00%> (ø)

... and 43 files with indirect coverage changes

@ReenigneArcher ReenigneArcher merged commit fb18b38 into LizardByte:master Jun 17, 2024
48 of 49 checks passed
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.

2 participants