From 8ab5296746a5f0ad147547bbd097d94b9503fbb2 Mon Sep 17 00:00:00 2001 From: jbouwh Date: Wed, 14 May 2025 14:32:38 +0000 Subject: [PATCH] Use b'\xc2\xb5' for micro sign instead of b'\xce\xbc` --- homeassistant/components/aranet/sensor.py | 2 +- homeassistant/components/fyta/sensor.py | 2 +- homeassistant/components/number/const.py | 6 +++--- homeassistant/components/sensor/const.py | 6 +++--- homeassistant/components/smartthings/sensor.py | 2 +- homeassistant/components/xiaomi_aqara/sensor.py | 2 +- homeassistant/const.py | 4 ++-- tests/components/aranet/test_sensor.py | 2 +- tests/components/conversation/test_chat_log.py | 2 +- tests/components/fyta/snapshots/test_sensor.ambr | 8 ++++---- .../smartthings/snapshots/test_diagnostics.ambr | 12 ++++++------ 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/homeassistant/components/aranet/sensor.py b/homeassistant/components/aranet/sensor.py index ee2eb8c8a75..a52cc668782 100644 --- a/homeassistant/components/aranet/sensor.py +++ b/homeassistant/components/aranet/sensor.py @@ -92,7 +92,7 @@ SENSOR_DESCRIPTIONS = { key="radiation_rate", translation_key="radiation_rate", name="Radiation Dose Rate", - native_unit_of_measurement="μSv/h", + native_unit_of_measurement="µSv/h", state_class=SensorStateClass.MEASUREMENT, suggested_display_precision=2, scale=0.001, diff --git a/homeassistant/components/fyta/sensor.py b/homeassistant/components/fyta/sensor.py index 622945ae102..15fdcedddfb 100644 --- a/homeassistant/components/fyta/sensor.py +++ b/homeassistant/components/fyta/sensor.py @@ -105,7 +105,7 @@ SENSORS: Final[list[FytaSensorEntityDescription]] = [ FytaSensorEntityDescription( key="light", translation_key="light", - native_unit_of_measurement="μmol/s⋅m²", + native_unit_of_measurement="µmol/s⋅m²", state_class=SensorStateClass.MEASUREMENT, value_fn=lambda plant: plant.light, ), diff --git a/homeassistant/components/number/const.py b/homeassistant/components/number/const.py index 58fa8ed1012..90a7ab5169c 100644 --- a/homeassistant/components/number/const.py +++ b/homeassistant/components/number/const.py @@ -265,19 +265,19 @@ class NumberDeviceClass(StrEnum): """ PM1 = "pm1" - """Particulate matter <= 1 μm. + """Particulate matter <= 1 µm. Unit of measurement: `µg/m³` """ PM10 = "pm10" - """Particulate matter <= 10 μm. + """Particulate matter <= 10 µm. Unit of measurement: `µg/m³` """ PM25 = "pm25" - """Particulate matter <= 2.5 μm. + """Particulate matter <= 2.5 µm. Unit of measurement: `µg/m³` """ diff --git a/homeassistant/components/sensor/const.py b/homeassistant/components/sensor/const.py index 2a8ac8099ab..aae0c4e2517 100644 --- a/homeassistant/components/sensor/const.py +++ b/homeassistant/components/sensor/const.py @@ -294,19 +294,19 @@ class SensorDeviceClass(StrEnum): """ PM1 = "pm1" - """Particulate matter <= 1 μm. + """Particulate matter <= 1 µm. Unit of measurement: `µg/m³` """ PM10 = "pm10" - """Particulate matter <= 10 μm. + """Particulate matter <= 10 µm. Unit of measurement: `µg/m³` """ PM25 = "pm25" - """Particulate matter <= 2.5 μm. + """Particulate matter <= 2.5 µm. Unit of measurement: `µg/m³` """ diff --git a/homeassistant/components/smartthings/sensor.py b/homeassistant/components/smartthings/sensor.py index fac503399a9..4339fce259e 100644 --- a/homeassistant/components/smartthings/sensor.py +++ b/homeassistant/components/smartthings/sensor.py @@ -1060,7 +1060,7 @@ UNITS = { "ccf": UnitOfVolume.CENTUM_CUBIC_FEET, "lux": LIGHT_LUX, "mG": None, - "μg/m^3": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, + "µg/m^3": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, } diff --git a/homeassistant/components/xiaomi_aqara/sensor.py b/homeassistant/components/xiaomi_aqara/sensor.py index 59ccee5a1a8..f9c1b7d004d 100644 --- a/homeassistant/components/xiaomi_aqara/sensor.py +++ b/homeassistant/components/xiaomi_aqara/sensor.py @@ -59,7 +59,7 @@ SENSOR_TYPES: dict[str, SensorEntityDescription] = { ), "bed_activity": SensorEntityDescription( key="bed_activity", - native_unit_of_measurement="μm", + native_unit_of_measurement="µm", device_class=None, state_class=SensorStateClass.MEASUREMENT, ), diff --git a/homeassistant/const.py b/homeassistant/const.py index f0615e7415b..875b5d4edff 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -684,7 +684,7 @@ class UnitOfTemperature(StrEnum): class UnitOfTime(StrEnum): """Time units.""" - MICROSECONDS = "μs" + MICROSECONDS = "µs" MILLISECONDS = "ms" SECONDS = "s" MINUTES = "min" @@ -902,7 +902,7 @@ class UnitOfPrecipitationDepth(StrEnum): # Concentration units CONCENTRATION_MICROGRAMS_PER_CUBIC_METER: Final = "µg/m³" CONCENTRATION_MILLIGRAMS_PER_CUBIC_METER: Final = "mg/m³" -CONCENTRATION_MICROGRAMS_PER_CUBIC_FOOT: Final = "μg/ft³" +CONCENTRATION_MICROGRAMS_PER_CUBIC_FOOT: Final = "µg/ft³" CONCENTRATION_PARTS_PER_CUBIC_METER: Final = "p/m³" CONCENTRATION_PARTS_PER_MILLION: Final = "ppm" CONCENTRATION_PARTS_PER_BILLION: Final = "ppb" diff --git a/tests/components/aranet/test_sensor.py b/tests/components/aranet/test_sensor.py index a1a5ca32378..76a2a3b91b1 100644 --- a/tests/components/aranet/test_sensor.py +++ b/tests/components/aranet/test_sensor.py @@ -65,7 +65,7 @@ async def test_sensors_aranet_radiation( temp_sensor_attrs[ATTR_FRIENDLY_NAME] == "Aranet\u2622 12345 Radiation Dose Rate" ) - assert temp_sensor_attrs[ATTR_UNIT_OF_MEASUREMENT] == "μSv/h" + assert temp_sensor_attrs[ATTR_UNIT_OF_MEASUREMENT] == "µSv/h" assert temp_sensor_attrs[ATTR_STATE_CLASS] == "measurement" interval_sensor = hass.states.get("sensor.aranet_12345_update_interval") diff --git a/tests/components/conversation/test_chat_log.py b/tests/components/conversation/test_chat_log.py index c9e72ae5a03..0f221698c40 100644 --- a/tests/components/conversation/test_chat_log.py +++ b/tests/components/conversation/test_chat_log.py @@ -709,7 +709,7 @@ async def test_chat_log_continue_conversation( chat_log.async_add_assistant_content_without_tools( AssistantContent( agent_id="mock-agent-id", - content="Ποιο είναι το αγαπημένο σου χρώμα στα ελληνικά;", + content="Ποιο είναι το αγαπηµένο σου χρώµα στα ελληνικά;", ) ) assert chat_log.continue_conversation is True diff --git a/tests/components/fyta/snapshots/test_sensor.ambr b/tests/components/fyta/snapshots/test_sensor.ambr index c43a7446f11..5f90e51c0fa 100644 --- a/tests/components/fyta/snapshots/test_sensor.ambr +++ b/tests/components/fyta/snapshots/test_sensor.ambr @@ -132,7 +132,7 @@ 'supported_features': 0, 'translation_key': 'light', 'unique_id': 'ce5f5431554d101905d31797e1232da8-0-light', - 'unit_of_measurement': 'μmol/s⋅m²', + 'unit_of_measurement': 'µmol/s⋅m²', }) # --- # name: test_all_entities[sensor.gummibaum_light-state] @@ -140,7 +140,7 @@ 'attributes': ReadOnlyDict({ 'friendly_name': 'Gummibaum Light', 'state_class': , - 'unit_of_measurement': 'μmol/s⋅m²', + 'unit_of_measurement': 'µmol/s⋅m²', }), 'context': , 'entity_id': 'sensor.gummibaum_light', @@ -971,7 +971,7 @@ 'supported_features': 0, 'translation_key': 'light', 'unique_id': 'ce5f5431554d101905d31797e1232da8-1-light', - 'unit_of_measurement': 'μmol/s⋅m²', + 'unit_of_measurement': 'µmol/s⋅m²', }) # --- # name: test_all_entities[sensor.kakaobaum_light-state] @@ -979,7 +979,7 @@ 'attributes': ReadOnlyDict({ 'friendly_name': 'Kakaobaum Light', 'state_class': , - 'unit_of_measurement': 'μmol/s⋅m²', + 'unit_of_measurement': 'µmol/s⋅m²', }), 'context': , 'entity_id': 'sensor.kakaobaum_light', diff --git a/tests/components/smartthings/snapshots/test_diagnostics.ambr b/tests/components/smartthings/snapshots/test_diagnostics.ambr index dc7f699de27..657a405d28c 100644 --- a/tests/components/smartthings/snapshots/test_diagnostics.ambr +++ b/tests/components/smartthings/snapshots/test_diagnostics.ambr @@ -854,12 +854,12 @@ 'dustSensor': dict({ 'dustLevel': dict({ 'timestamp': '2021-04-06T16:44:10.122Z', - 'unit': 'μg/m^3', + 'unit': 'µg/m^3', 'value': None, }), 'fineDustLevel': dict({ 'timestamp': '2021-04-06T16:44:10.122Z', - 'unit': 'μg/m^3', + 'unit': 'µg/m^3', 'value': None, }), }), @@ -994,7 +994,7 @@ 'veryFineDustSensor': dict({ 'veryFineDustLevel': dict({ 'timestamp': '2021-04-06T16:43:38.529Z', - 'unit': 'μg/m^3', + 'unit': 'µg/m^3', 'value': None, }), }), @@ -1260,12 +1260,12 @@ 'dustSensor': dict({ 'dustLevel': dict({ 'timestamp': '2021-04-06T16:43:35.665Z', - 'unit': 'μg/m^3', + 'unit': 'µg/m^3', 'value': None, }), 'fineDustLevel': dict({ 'timestamp': '2021-04-06T16:43:35.665Z', - 'unit': 'μg/m^3', + 'unit': 'µg/m^3', 'value': None, }), }), @@ -1521,7 +1521,7 @@ 'veryFineDustSensor': dict({ 'veryFineDustLevel': dict({ 'timestamp': '2021-04-06T16:43:35.363Z', - 'unit': 'μg/m^3', + 'unit': 'µg/m^3', 'value': None, }), }),