mirror of
https://github.com/home-assistant/core.git
synced 2026-12-04 12:50:45 -04:00
Use UnitOfRatio.PERCENTAGE in Huum number (#187803)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
c80edc1398
commit
40ab5dc6cb
@@ -6,6 +6,7 @@ from typing import override
|
||||
from huum.const import SaunaStatus
|
||||
|
||||
from homeassistant.components.number import NumberDeviceClass, NumberEntity
|
||||
from homeassistant.const import UnitOfRatio
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
|
||||
|
||||
@@ -36,7 +37,7 @@ class HuumSteamer(HuumBaseEntity, NumberEntity):
|
||||
|
||||
_attr_translation_key = "humidity"
|
||||
_attr_device_class = NumberDeviceClass.HUMIDITY
|
||||
_attr_native_unit_of_measurement = "%"
|
||||
_attr_native_unit_of_measurement = UnitOfRatio.PERCENTAGE
|
||||
_attr_native_max_value = 40
|
||||
_attr_native_min_value = 0
|
||||
_attr_native_step = 1
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
'supported_features': 0,
|
||||
'translation_key': 'humidity',
|
||||
'unique_id': 'AABBCC112233',
|
||||
'unit_of_measurement': '%',
|
||||
'unit_of_measurement': <UnitOfRatio.PERCENTAGE: '%'>,
|
||||
})
|
||||
# ---
|
||||
# name: test_number_entity[number.huum_sauna_humidity-state]
|
||||
@@ -50,7 +50,7 @@
|
||||
<NumberEntityCapabilityAttribute.MIN: 'min'>: 0,
|
||||
<NumberEntityCapabilityAttribute.MODE: 'mode'>: <NumberMode.AUTO: 'auto'>,
|
||||
<NumberEntityCapabilityAttribute.STEP: 'step'>: 1,
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: '%',
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfRatio.PERCENTAGE: '%'>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'number.huum_sauna_humidity',
|
||||
|
||||
Reference in New Issue
Block a user