Bump aioswitcher to 4.0.0 (#123260)

* Bump aioswitcher to 4.0.0

* switcher fix version

* swithcer fix test

* switcher fix tests
pull/123485/head
YogevBokobza 2024-08-09 20:04:11 +03:00 committed by GitHub
parent 8e34a0d3c7
commit 57da71c537
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 19 additions and 6 deletions

View File

@ -137,6 +137,7 @@ class SwitcherThermostatButtonEntity(
try:
async with SwitcherType2Api(
self.coordinator.data.device_type,
self.coordinator.data.ip_address,
self.coordinator.data.device_id,
self.coordinator.data.device_key,

View File

@ -169,6 +169,7 @@ class SwitcherClimateEntity(
try:
async with SwitcherType2Api(
self.coordinator.data.device_type,
self.coordinator.data.ip_address,
self.coordinator.data.device_id,
self.coordinator.data.device_key,

View File

@ -29,7 +29,7 @@ from .coordinator import SwitcherDataUpdateCoordinator
_LOGGER = logging.getLogger(__name__)
API_SET_POSITON = "set_position"
API_STOP = "stop"
API_STOP = "stop_shutter"
async def async_setup_entry(
@ -98,6 +98,7 @@ class SwitcherCoverEntity(
try:
async with SwitcherType2Api(
self.coordinator.data.device_type,
self.coordinator.data.ip_address,
self.coordinator.data.device_id,
self.coordinator.data.device_key,

View File

@ -7,6 +7,6 @@
"iot_class": "local_push",
"loggers": ["aioswitcher"],
"quality_scale": "platinum",
"requirements": ["aioswitcher==3.4.3"],
"requirements": ["aioswitcher==4.0.0"],
"single_config_entry": true
}

View File

@ -117,6 +117,7 @@ class SwitcherBaseSwitchEntity(
try:
async with SwitcherType1Api(
self.coordinator.data.device_type,
self.coordinator.data.ip_address,
self.coordinator.data.device_id,
self.coordinator.data.device_key,

View File

@ -374,7 +374,7 @@ aiosolaredge==0.2.0
aiosteamist==1.0.0
# homeassistant.components.switcher_kis
aioswitcher==3.4.3
aioswitcher==4.0.0
# homeassistant.components.syncthing
aiosyncthing==0.5.1

View File

@ -356,7 +356,7 @@ aiosolaredge==0.2.0
aiosteamist==1.0.0
# homeassistant.components.switcher_kis
aioswitcher==3.4.3
aioswitcher==4.0.0
# homeassistant.components.syncthing
aiosyncthing==0.5.1

View File

@ -38,6 +38,10 @@ DUMMY_MAC_ADDRESS1 = "A1:B2:C3:45:67:D8"
DUMMY_MAC_ADDRESS2 = "A1:B2:C3:45:67:D9"
DUMMY_MAC_ADDRESS3 = "A1:B2:C3:45:67:DA"
DUMMY_MAC_ADDRESS4 = "A1:B2:C3:45:67:DB"
DUMMY_TOKEN_NEEDED1 = False
DUMMY_TOKEN_NEEDED2 = False
DUMMY_TOKEN_NEEDED3 = False
DUMMY_TOKEN_NEEDED4 = False
DUMMY_PHONE_ID = "1234"
DUMMY_POWER_CONSUMPTION1 = 100
DUMMY_POWER_CONSUMPTION2 = 2780
@ -60,6 +64,7 @@ DUMMY_PLUG_DEVICE = SwitcherPowerPlug(
DUMMY_IP_ADDRESS1,
DUMMY_MAC_ADDRESS1,
DUMMY_DEVICE_NAME1,
DUMMY_TOKEN_NEEDED1,
DUMMY_POWER_CONSUMPTION1,
DUMMY_ELECTRIC_CURRENT1,
)
@ -72,6 +77,7 @@ DUMMY_WATER_HEATER_DEVICE = SwitcherWaterHeater(
DUMMY_IP_ADDRESS2,
DUMMY_MAC_ADDRESS2,
DUMMY_DEVICE_NAME2,
DUMMY_TOKEN_NEEDED2,
DUMMY_POWER_CONSUMPTION2,
DUMMY_ELECTRIC_CURRENT2,
DUMMY_REMAINING_TIME,
@ -86,6 +92,7 @@ DUMMY_SHUTTER_DEVICE = SwitcherShutter(
DUMMY_IP_ADDRESS4,
DUMMY_MAC_ADDRESS4,
DUMMY_DEVICE_NAME4,
DUMMY_TOKEN_NEEDED4,
DUMMY_POSITION,
DUMMY_DIRECTION,
)
@ -98,6 +105,7 @@ DUMMY_THERMOSTAT_DEVICE = SwitcherThermostat(
DUMMY_IP_ADDRESS3,
DUMMY_MAC_ADDRESS3,
DUMMY_DEVICE_NAME3,
DUMMY_TOKEN_NEEDED3,
DUMMY_THERMOSTAT_MODE,
DUMMY_TEMPERATURE,
DUMMY_TARGET_TEMPERATURE,

View File

@ -105,7 +105,7 @@ async def test_cover(
# Test stop
with patch(
"homeassistant.components.switcher_kis.cover.SwitcherType2Api.stop"
"homeassistant.components.switcher_kis.cover.SwitcherType2Api.stop_shutter"
) as mock_control_device:
await hass.services.async_call(
COVER_DOMAIN,

View File

@ -40,7 +40,7 @@ async def test_diagnostics(
"__type": "<enum 'DeviceType'>",
"repr": (
"<DeviceType.V4: ('Switcher V4', '0317', "
"1, <DeviceCategory.WATER_HEATER: 1>)>"
"1, <DeviceCategory.WATER_HEATER: 1>, False)>"
),
},
"electric_current": 12.8,
@ -50,6 +50,7 @@ async def test_diagnostics(
"name": "Heater FE12",
"power_consumption": 2780,
"remaining_time": "01:29:32",
"token_needed": False,
}
],
"entry": {