You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Resolve a currency symbol to a code wherever it arrives
AlphaESS has started answering moneyType with the symbol rather than an ISO
code - "€" where it used to send "EUR". Home Assistant's monetary device class
only accepts a code, so the symbol had to be resolved before it reached a unit.
The mapping already existed in the sensor platform, so the monetary units were
never wrong, but two things around it were. The Currency Code sensor reports
whatever the API sent, so it now reads "€" - a symbol, from a sensor named for
a code, and the same value goes into the diagnostics download. The parser now
resolves it once, so both report a code.
The other is a symbol that names more than one currency. "$" resolved to USD
whatever the owner's currency, which is wrong for every AUD, NZD and CAD system
- a good share of them - and "¥" resolved to JPY for a Chinese one. An
ambiguous symbol now resolves to the currency Home Assistant is configured for
when that is one of the candidates, and to the most common otherwise. An
unrecognised value still falls back rather than being guessed at.
The mapping moves to its own module so the parser and the sensor platform share
one answer, and it gains 元 and Kč on the way through.
0 commit comments