mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Update apsystems library to support battery inverter (#140086)
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
5a1aeff85c
commit
acbee815be
@ -43,6 +43,7 @@ class ApSystemsDataCoordinator(DataUpdateCoordinator[ApSystemsSensorData]):
|
||||
|
||||
config_entry: ApSystemsConfigEntry
|
||||
device_version: str
|
||||
battery_system: bool
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@ -68,6 +69,7 @@ class ApSystemsDataCoordinator(DataUpdateCoordinator[ApSystemsSensorData]):
|
||||
self.api.max_power = device_info.maxPower
|
||||
self.api.min_power = device_info.minPower
|
||||
self.device_version = device_info.devVer
|
||||
self.battery_system = device_info.isBatterySystem
|
||||
|
||||
async def _async_update_data(self) -> ApSystemsSensorData:
|
||||
try:
|
||||
|
@ -6,5 +6,5 @@
|
||||
"documentation": "https://www.home-assistant.io/integrations/apsystems",
|
||||
"integration_type": "device",
|
||||
"iot_class": "local_polling",
|
||||
"requirements": ["apsystems-ez1==2.4.0"]
|
||||
"requirements": ["apsystems-ez1==2.5.0"]
|
||||
}
|
||||
|
@ -36,6 +36,8 @@ class ApSystemsInverterSwitch(ApSystemsEntity, SwitchEntity):
|
||||
super().__init__(data)
|
||||
self._api = data.coordinator.api
|
||||
self._attr_unique_id = f"{data.device_id}_inverter_status"
|
||||
if data.coordinator.battery_system:
|
||||
self._attr_available = False
|
||||
|
||||
async def async_update(self) -> None:
|
||||
"""Update switch status and availability."""
|
||||
|
2
requirements_all.txt
generated
2
requirements_all.txt
generated
@ -491,7 +491,7 @@ apprise==1.9.1
|
||||
aprslib==0.7.2
|
||||
|
||||
# homeassistant.components.apsystems
|
||||
apsystems-ez1==2.4.0
|
||||
apsystems-ez1==2.5.0
|
||||
|
||||
# homeassistant.components.aqualogic
|
||||
aqualogic==2.6
|
||||
|
2
requirements_test_all.txt
generated
2
requirements_test_all.txt
generated
@ -464,7 +464,7 @@ apprise==1.9.1
|
||||
aprslib==0.7.2
|
||||
|
||||
# homeassistant.components.apsystems
|
||||
apsystems-ez1==2.4.0
|
||||
apsystems-ez1==2.5.0
|
||||
|
||||
# homeassistant.components.aranet
|
||||
aranet4==2.5.1
|
||||
|
@ -43,6 +43,7 @@ def mock_apsystems() -> Generator[MagicMock]:
|
||||
ipAddr="127.0.01",
|
||||
minPower=0,
|
||||
maxPower=1000,
|
||||
isBatterySystem=False,
|
||||
)
|
||||
mock_api.get_output_data.return_value = ReturnOutputData(
|
||||
p1=2.0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user