Bump apsystems-ez1 to 2.1.0 (#123225)
Library update for apsystems fixing breaking changes
This commit is contained in:
parent
110ee9ff35
commit
f4997e46fb
6 changed files with 16 additions and 17 deletions
|
@ -35,28 +35,28 @@ BINARY_SENSORS: tuple[ApsystemsLocalApiBinarySensorDescription, ...] = (
|
|||
translation_key="off_grid_status",
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
is_on=lambda c: bool(c.og),
|
||||
is_on=lambda c: c.offgrid,
|
||||
),
|
||||
ApsystemsLocalApiBinarySensorDescription(
|
||||
key="dc_1_short_circuit_error_status",
|
||||
translation_key="dc_1_short_circuit_error_status",
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
is_on=lambda c: bool(c.isce1),
|
||||
is_on=lambda c: c.shortcircuit_1,
|
||||
),
|
||||
ApsystemsLocalApiBinarySensorDescription(
|
||||
key="dc_2_short_circuit_error_status",
|
||||
translation_key="dc_2_short_circuit_error_status",
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
is_on=lambda c: bool(c.isce2),
|
||||
is_on=lambda c: c.shortcircuit_2,
|
||||
),
|
||||
ApsystemsLocalApiBinarySensorDescription(
|
||||
key="output_fault_status",
|
||||
translation_key="output_fault_status",
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
is_on=lambda c: bool(c.oe),
|
||||
is_on=lambda c: not c.operating,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
@ -6,5 +6,5 @@
|
|||
"documentation": "https://www.home-assistant.io/integrations/apsystems",
|
||||
"integration_type": "device",
|
||||
"iot_class": "local_polling",
|
||||
"requirements": ["apsystems-ez1==1.3.3"]
|
||||
"requirements": ["apsystems-ez1==2.1.0"]
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ from __future__ import annotations
|
|||
from typing import Any
|
||||
|
||||
from aiohttp.client_exceptions import ClientConnectionError
|
||||
from APsystemsEZ1 import Status
|
||||
|
||||
from homeassistant.components.switch import SwitchDeviceClass, SwitchEntity
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
@ -45,12 +44,12 @@ class ApSystemsInverterSwitch(ApSystemsEntity, SwitchEntity):
|
|||
self._attr_available = False
|
||||
else:
|
||||
self._attr_available = True
|
||||
self._attr_is_on = status == Status.normal
|
||||
self._attr_is_on = status
|
||||
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
"""Turn the switch on."""
|
||||
await self._api.set_device_power_status(0)
|
||||
await self._api.set_device_power_status(True)
|
||||
|
||||
async def async_turn_off(self, **kwargs: Any) -> None:
|
||||
"""Turn the switch off."""
|
||||
await self._api.set_device_power_status(1)
|
||||
await self._api.set_device_power_status(False)
|
||||
|
|
|
@ -464,7 +464,7 @@ apprise==1.8.0
|
|||
aprslib==0.7.2
|
||||
|
||||
# homeassistant.components.apsystems
|
||||
apsystems-ez1==1.3.3
|
||||
apsystems-ez1==2.1.0
|
||||
|
||||
# homeassistant.components.aqualogic
|
||||
aqualogic==2.6
|
||||
|
|
|
@ -437,7 +437,7 @@ apprise==1.8.0
|
|||
aprslib==0.7.2
|
||||
|
||||
# homeassistant.components.apsystems
|
||||
apsystems-ez1==1.3.3
|
||||
apsystems-ez1==2.1.0
|
||||
|
||||
# homeassistant.components.aranet
|
||||
aranet4==2.3.4
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
from collections.abc import Generator
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
from APsystemsEZ1 import ReturnAlarmInfo, ReturnDeviceInfo, ReturnOutputData, Status
|
||||
from APsystemsEZ1 import ReturnAlarmInfo, ReturnDeviceInfo, ReturnOutputData
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.apsystems.const import DOMAIN
|
||||
|
@ -53,12 +53,12 @@ def mock_apsystems() -> Generator[MagicMock]:
|
|||
te2=7.0,
|
||||
)
|
||||
mock_api.get_alarm_info.return_value = ReturnAlarmInfo(
|
||||
og=Status.normal,
|
||||
isce1=Status.alarm,
|
||||
isce2=Status.normal,
|
||||
oe=Status.alarm,
|
||||
offgrid=False,
|
||||
shortcircuit_1=True,
|
||||
shortcircuit_2=False,
|
||||
operating=False,
|
||||
)
|
||||
mock_api.get_device_power_status.return_value = Status.normal
|
||||
mock_api.get_device_power_status.return_value = True
|
||||
yield mock_api
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue