Skip to content

Commit

Permalink
feat: Number platform - add input mode control
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrapan committed Oct 8, 2024
1 parent fa6b9ca commit 366d821
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ parameters:
configurable:
min: 0
max: 100
step: 0.1
mode: box
range:
min: 0
max: 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ parameters:
configurable:
min: 0
max: 100
step: 0.1
mode: box
range:
min: 0
max: 100
Expand Down
2 changes: 2 additions & 0 deletions custom_components/solarman/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def __init__(self, coordinator, sensor):
_LOGGER.warning(f"SolarmanNumberEntity.__init__: Contains more than 1 register!")

if "configurable" in sensor and (configurable := sensor["configurable"]):
if "mode" in configurable:
self._attr_mode = configurable["mode"]
if "min" in configurable:
self._attr_native_min_value = configurable["min"]
if "max" in configurable:
Expand Down

0 comments on commit 366d821

Please sign in to comment.