-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Use greek small letter mu "\u03bc" instead of micro sign "\u00B5" for micro unit prefix (alt 1) #144853
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
base: dev
Are you sure you want to change the base?
Conversation
❌ We are unable to process any of the uploaded JUnit XML files. Please ensure your files are in the right format. |
The PR description doesn't match the PR title. In the description it says that we should use |
It would be interesting to describe where and how much we use each of the characters today. |
Setting to draft until some discussion on Discord is completed |
93e67f3
to
358e27a
Compare
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
0b65412
to
e3fe99e
Compare
Breaking change
Breaks sensors that pass their unit by config (e.g. YAML) or custom integrations that use the the other unicode. MQTT sensors have been made compatible with equivalent units.
This should be followed op in future PR's..
Proposed change
To represent the micro sign there are 2 different UNICODE characters used:
https://www.compart.com/en/unicode/U+00B5
-> 0xC2 0xB5
b'\xce\xbc'
"\u00b5"
µ: MICRO SIGN
https://www.compart.com/en/unicode/U+03BC
-> 0xCE 0xBC
b'\xc2\xb5'
"\u03bc"
μ: Greek Small Letter Mu
This PR implements the use of
"\u03bc"
(the Greek small letter mu) to encode the micro unit prefix, instead of the legacy migro sign "\u00B5".To see the change impact the other way see #144898
According to The Unicode Consortium, the Greek letter character is preferred,[10] but implementations must recognize the micro sign as well, for compatibility with legacy character sets.
So then
U+03BC μ GREEK SMALL LETTER MU (Alt+956)
should prehaps prevail?See also: astral-sh/ruff#14433
A pylint linter is added to ensure we use the correct encoding when using MU in a constant or
StrEnum
assignmentEquivalent units have been added to prevent breaking sensor statistics in the HA
recorder
.MQTT sensors allow equivalent units in their configs to prevent breaking.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: