Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion custom_components/smartevse/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"documentation": "https://github.com/dingo35/ha-SmartEVSEv3",
"iot_class": "local_polling",
"issue_tracker": "https://github.com/dingo35/ha-SmartEVSEv3/issues",
"version": "1.1.4",
"version": "1.1.5",
"zeroconf": ["_http._tcp.local."]
}
20 changes: 20 additions & 0 deletions custom_components/smartevse/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,26 @@ def __init__(
if entity_description.native_step is not None:
self._attr_native_step = entity_description.native_step

@property
def native_max_value(self) -> float:
"""Return the maximum settable value.

For the override current, follow the SmartEVSE's own reported maximum
(settings.current_max) rather than a fixed cap, so a controller configured
for e.g. 32 A can actually be driven to 32 A. Falls back to the static
description value when the device max is unavailable.
"""
if self.entity_description.key == "smartevse_override_current":
data = self.coordinator.data
if data:
device_max = data.get("smartevse_current_max")
if device_max is not None:
try:
return float(device_max)
except (TypeError, ValueError):
pass
return self._attr_native_max_value

@property
def native_value(self) -> float | None:
"""Return the entity value to represent the entity state."""
Expand Down
Loading