Skip to content

Commit 638b124

Browse files
committed
use slider mode for numbers with no mappings
1 parent 01716a8 commit 638b124

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

custom_components/smarter/helpers/device_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from typing import Any
1111

1212
from homeassistant.components.binary_sensor import BinarySensorEntityDescription
13-
from homeassistant.components.number import NumberEntityDescription
13+
from homeassistant.components.number import NumberEntityDescription, NumberMode
1414
from homeassistant.components.sensor import SensorEntityDescription
1515
from homeassistant.components.switch import SwitchEntityDescription
1616
from homeassistant.const import EntityCategory, Platform, UnitOfTemperature
@@ -374,6 +374,7 @@ def number_entity_description(self) -> NumberEntityDescription:
374374
key=self.key,
375375
device_class=self.device_class,
376376
entity_category=self.category,
377+
mode=NumberMode.BOX if len(self._mappings) > 0 else NumberMode.SLIDER,
377378
icon=self.icon,
378379
translation_key=self.translation_key,
379380
translation_placeholders=self.translation_placeholders,

0 commit comments

Comments
 (0)