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

Prevent transient error messages where no temperature is provided #428

Open
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

rrobgill
Copy link

What does this PR aim to accomplish?:

Prevent transient error messages on refresh where hardware temperature is not reported under v6.

2025-02-24_12:10:59

How does this PR accomplish the above?:

Avoids attempts to calculate from a null value. Existing mechanism to indicate unknown units is used.

2025-02-24_13:35:29


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)
  6. I have checked that another pull request for this purpose does not exist.
  7. I have considered, and confirmed that this submission will be valuable to others.
  8. I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  9. I give this submission freely, and claim no ownership to its content.

  • I have read the above and my PR is ready for review. Check this box to confirm

Copy link
Member

@yubiuser yubiuser left a comment

Choose a reason for hiding this comment

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

Thanks for your PR:

Could you also please change L435/437 to show N/A . I think showing °? in case no data is returned at all is not the best solution.

@yubiuser yubiuser linked an issue Feb 24, 2025 that may be closed by this pull request
Align printf text padding to account for presence/absence of unicode degree symbol

Signed-off-by: Rob Gill <[email protected]>
@rrobgill
Copy link
Author

Could you also please change L435/437 to show N/A . I think showing °? in case no data is returned at all is not the best solution.

Changing it to N/A required further adjustment.

The spacings originally present are assuming the presence of a multibyte unicode ° symbol. As printf's padding counts bytes, not characters (https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap05.html#tag_05) this throws the column alignment off if there is no degree symbol.

It turns out this was also effecting the spacing if the units were set to Kelvins.

@yubiuser
Copy link
Member

Thanks for being that precise. I'd like to group similar things together, please put all the padding calculation into GenerateSizeDependendOutput()

Copy link
Member

@yubiuser yubiuser left a comment

Choose a reason for hiding this comment

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

I think Kelvin need some padding as well. See how 'CPU load' moved to the right

2025-02-26_15-30

2025-02-26_15-29

@rrobgill
Copy link
Author

It now clears the flags explicitly, so won't misalign if units change on the fly.

@yubiuser yubiuser mentioned this pull request Feb 27, 2025
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.

push development branch to master
2 participants