Skip to content
Merged
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
27 changes: 18 additions & 9 deletions custom_components/solax_modbus/plugin_solax.py
Original file line number Diff line number Diff line change
Expand Up @@ -11795,7 +11795,13 @@ def localDataCallback(self, hub: Any) -> bool:
)
_LOGGER.info(f"Parallel Master: Set {key} limits to ±{system_limit_w}W (inverter_power_kw={hub.inverterPowerKw}kW)")

# For single inverters or if config_max_export is enabled, use config_max_export
# For single inverters or if config_max_export is enabled, use config_max_export.
# Parallel Master remote-control limits are handled above using total system power,
# but export_control_user_limit still needs the configured max export range.
parallel_master_remotecontrol_keys = {
"remotecontrol_active_power",
"remotecontrol_import_limit",
}
config_maxexport_entity = hub.numberEntities.get("config_max_export")
if config_maxexport_entity and config_maxexport_entity.enabled:
new_max_export = hub.data.get("config_max_export")
Expand All @@ -11807,14 +11813,17 @@ def localDataCallback(self, hub: Any) -> bool:
"generator_max_charge",
]:
number_entity = hub.numberEntities.get(key)
if number_entity and parallel_setting != "Master": # Don't override parallel Master
number_entity._attr_native_max_value = new_max_export
# update description also, not sure whether needed or not
number_entity.entity_description = replace(
number_entity.entity_description,
native_max_value=new_max_export,
)
_LOGGER.info(f"local data update callback for entity: {key} new limit: {new_max_export}")
if not number_entity:
continue
if parallel_setting == "Master" and key in parallel_master_remotecontrol_keys:
continue
number_entity._attr_native_max_value = new_max_export
# update description also, not sure whether needed or not
number_entity.entity_description = replace(
number_entity.entity_description,
native_max_value=new_max_export,
)
_LOGGER.info(f"local data update callback for entity: {key} new limit: {new_max_export}")

return False

Expand Down
Loading