mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Fix missing unit of measurement in tuya numbers (#148924)
This commit is contained in:
parent
e32e06d7a0
commit
ae03fc2295
@ -381,6 +381,8 @@ class TuyaNumberEntity(TuyaEntity, NumberEntity):
|
||||
self._attr_native_max_value = self._number.max_scaled
|
||||
self._attr_native_min_value = self._number.min_scaled
|
||||
self._attr_native_step = self._number.step_scaled
|
||||
if description.native_unit_of_measurement is None:
|
||||
self._attr_native_unit_of_measurement = int_type.unit
|
||||
|
||||
# Logic to ensure the set device class and API received Unit Of Measurement
|
||||
# match Home Assistants requirements.
|
||||
|
@ -95,7 +95,7 @@
|
||||
'supported_features': 0,
|
||||
'translation_key': 'feed',
|
||||
'unique_id': 'tuya.bfd0273e59494eb34esvrxmanual_feed',
|
||||
'unit_of_measurement': None,
|
||||
'unit_of_measurement': '',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[cwwsq_cleverio_pf100][number.cleverio_pf100_feed-state]
|
||||
@ -106,6 +106,7 @@
|
||||
'min': 1.0,
|
||||
'mode': <NumberMode.AUTO: 'auto'>,
|
||||
'step': 1.0,
|
||||
'unit_of_measurement': '',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'number.cleverio_pf100_feed',
|
||||
@ -152,7 +153,7 @@
|
||||
'supported_features': 0,
|
||||
'translation_key': 'temp_correction',
|
||||
'unique_id': 'tuya.bfb45cb8a9452fba66lexgtemp_correction',
|
||||
'unit_of_measurement': None,
|
||||
'unit_of_measurement': '℃',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[wk_wifi_smart_gas_boiler_thermostat][number.wifi_smart_gas_boiler_thermostat_temperature_correction-state]
|
||||
@ -163,6 +164,7 @@
|
||||
'min': -9.9,
|
||||
'mode': <NumberMode.AUTO: 'auto'>,
|
||||
'step': 0.1,
|
||||
'unit_of_measurement': '℃',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'number.wifi_smart_gas_boiler_thermostat_temperature_correction',
|
||||
|
Loading…
x
Reference in New Issue
Block a user