Skip to content

Commit

Permalink
Fix max value of grid_export_limit
Browse files Browse the repository at this point in the history
  • Loading branch information
mletenay committed May 5, 2024
1 parent caf8006 commit 2eb2b7d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions custom_components/goodwe/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,14 @@ async def async_setup_entry(
continue

entity = InverterNumberEntity(device_info, description, inverter, current_value)
# Adjust the max value according to actual inverter power (if provided)
# Set the max value of grid_export_limit (W version)
if (
inverter.rated_power
and description.key == "grid_export_limit"
description.key == "grid_export_limit"
and description.native_unit_of_measurement == UnitOfPower.WATT
):
entity.native_max_value = inverter.rated_power
entity.native_max_value = (
inverter.rated_power * 2 if inverter.rated_power else 10000
)
entities.append(entity)

async_add_entities(entities)
Expand Down

0 comments on commit 2eb2b7d

Please sign in to comment.