Use user defined charge limit for charge limit range in Peblar (#133868)

This commit is contained in:
Duco Sebel
2024-12-23 10:27:53 +01:00
committed by GitHub
parent a6f6317299
commit 59d8c79371

View File

@@ -46,7 +46,7 @@ DESCRIPTIONS = [
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
native_step=1, native_step=1,
native_min_value=6, native_min_value=6,
native_max_value_fn=lambda x: x.system_information.hardware_max_current, native_max_value_fn=lambda x: x.user_configuration_coordinator.data.user_defined_charge_limit_current,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
set_value_fn=lambda x, v: x.ev_interface(charge_current_limit=int(v) * 1000), set_value_fn=lambda x, v: x.ev_interface(charge_current_limit=int(v) * 1000),
value_fn=lambda x: round(x.ev.charge_current_limit / 1000), value_fn=lambda x: round(x.ev.charge_current_limit / 1000),