Set min_power similar to max_power to support all inverters from apsystems (#124247)
Set min_power similar to max_power to support all inverters from apsystems ez1 series
This commit is contained in:
parent
e3e48ff9b7
commit
069b7a45ed
2 changed files with 4 additions and 3 deletions
|
@ -36,10 +36,11 @@ class ApSystemsDataCoordinator(DataUpdateCoordinator[ApSystemsSensorData]):
|
|||
|
||||
async def _async_setup(self) -> None:
|
||||
try:
|
||||
max_power = (await self.api.get_device_info()).maxPower
|
||||
device_info = await self.api.get_device_info()
|
||||
except (ConnectionError, TimeoutError):
|
||||
raise UpdateFailed from None
|
||||
self.api.max_power = max_power
|
||||
self.api.max_power = device_info.maxPower
|
||||
self.api.min_power = device_info.minPower
|
||||
|
||||
async def _async_update_data(self) -> ApSystemsSensorData:
|
||||
output_data = await self.api.get_output_data()
|
||||
|
|
|
@ -26,7 +26,6 @@ async def async_setup_entry(
|
|||
class ApSystemsMaxOutputNumber(ApSystemsEntity, NumberEntity):
|
||||
"""Base sensor to be used with description."""
|
||||
|
||||
_attr_native_min_value = 30
|
||||
_attr_native_step = 1
|
||||
_attr_device_class = NumberDeviceClass.POWER
|
||||
_attr_mode = NumberMode.BOX
|
||||
|
@ -42,6 +41,7 @@ class ApSystemsMaxOutputNumber(ApSystemsEntity, NumberEntity):
|
|||
self._api = data.coordinator.api
|
||||
self._attr_unique_id = f"{data.device_id}_output_limit"
|
||||
self._attr_native_max_value = data.coordinator.api.max_power
|
||||
self._attr_native_min_value = data.coordinator.api.min_power
|
||||
|
||||
async def async_update(self) -> None:
|
||||
"""Set the state with the value fetched from the inverter."""
|
||||
|
|
Loading…
Add table
Reference in a new issue