Skip to content

Conversation

@rrobgill
Copy link
Contributor

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
@rrobgill
Copy link
Contributor 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
Contributor 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
yubiuser
yubiuser previously approved these changes Feb 28, 2025
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.

Perfect!

Could you please squash it down to 1 or 2 commits and rebase on latest development?

@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link

github-actions bot commented Mar 1, 2025

Conflicts have been resolved.

@yubiuser yubiuser merged commit 506c0b6 into pi-hole:development Mar 4, 2025
3 checks passed
@rrobgill rrobgill deleted the handlenull branch April 14, 2025 22:24
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