Skip to content

Commit

Permalink
Temperature unit: return strings from unit_from_ascii
Browse files Browse the repository at this point in the history
This helper function is just for translating simple ASCII into more
complex Unicode units (C to °C, m3 to m³ etc) to make editing files
easier.

Now that HA converted most of the unit constants into Enum's, they are
converting to instances of enums, which might no work in some cases.

Issue #1855

Unit tests appear to have coverage of this, and were not deteecting
any issues, but this is the only possiblity I can see for the issue
not being resolved.
  • Loading branch information
make-all committed Jun 5, 2024
1 parent 64f6737 commit d6634c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/tuya_local/helpers/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ def on_receive(self, dps, full_poll):


UNIT_ASCII_MAP = {
"C": UnitOfTemperature.CELSIUS,
"F": UnitOfTemperature.FAHRENHEIT,
"C": UnitOfTemperature.CELSIUS.value,
"F": UnitOfTemperature.FAHRENHEIT.value,
"ugm3": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
"m2": AREA_SQUARE_METERS,
}
Expand Down

0 comments on commit d6634c4

Please sign in to comment.