Fix using the unit reported by the numerical sensor

This commit is contained in:
Adrian Jagielak 2025-07-28 16:13:18 +02:00
parent 850fc7fc57
commit 0d993643fb
No known key found for this signature in database
GPG Key ID: 0818CF7AF6C62BFB
2 changed files with 2 additions and 1 deletions

View File

@ -5,6 +5,7 @@
- Added logo.
- Added support for pairing new devices.
- Added support for unpairing devices.
- Fixed using the unit reported by the numerical sensor.
## 0.1.7 (26.07.2025)

View File

@ -74,7 +74,7 @@ export function _sensor_numeric__components(
const device_class = data[0];
const name = data[1];
let unit = data[2];
let unit = svc.props?.sup_units?.[0] ?? data[2];
if (unit === 'C') unit = '°C';
if (unit === 'F') unit = '°F';
if (unit === 'kph') unit = 'km/h';