Bump aioswitcher to 3.4.1 (#107730)
* switcher: added support for device_key logic included in aioswitcher==3.4.1 * switcher: small fix * switcher: after lint * switcher: fix missing device_key in tests * remove device_key function * fix missing device_key in tests
This commit is contained in:
parent
d89659f196
commit
b87bbd1529
11 changed files with 27 additions and 9 deletions
|
@ -89,8 +89,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
|
|
||||||
# New device - create device
|
# New device - create device
|
||||||
_LOGGER.info(
|
_LOGGER.info(
|
||||||
"Discovered Switcher device - id: %s, name: %s, type: %s (%s)",
|
"Discovered Switcher device - id: %s, key: %s, name: %s, type: %s (%s)",
|
||||||
device.device_id,
|
device.device_id,
|
||||||
|
device.device_key,
|
||||||
device.name,
|
device.name,
|
||||||
device.device_type.value,
|
device.device_type.value,
|
||||||
device.device_type.hex_rep,
|
device.device_type.hex_rep,
|
||||||
|
|
|
@ -142,7 +142,9 @@ class SwitcherThermostatButtonEntity(
|
||||||
|
|
||||||
try:
|
try:
|
||||||
async with SwitcherType2Api(
|
async with SwitcherType2Api(
|
||||||
self.coordinator.data.ip_address, self.coordinator.data.device_id
|
self.coordinator.data.ip_address,
|
||||||
|
self.coordinator.data.device_id,
|
||||||
|
self.coordinator.data.device_key,
|
||||||
) as swapi:
|
) as swapi:
|
||||||
response = await self.entity_description.press_fn(swapi, self._remote)
|
response = await self.entity_description.press_fn(swapi, self._remote)
|
||||||
except (asyncio.TimeoutError, OSError, RuntimeError) as err:
|
except (asyncio.TimeoutError, OSError, RuntimeError) as err:
|
||||||
|
|
|
@ -162,7 +162,9 @@ class SwitcherClimateEntity(
|
||||||
|
|
||||||
try:
|
try:
|
||||||
async with SwitcherType2Api(
|
async with SwitcherType2Api(
|
||||||
self.coordinator.data.ip_address, self.coordinator.data.device_id
|
self.coordinator.data.ip_address,
|
||||||
|
self.coordinator.data.device_id,
|
||||||
|
self.coordinator.data.device_key,
|
||||||
) as swapi:
|
) as swapi:
|
||||||
response = await swapi.control_breeze_device(self._remote, **kwargs)
|
response = await swapi.control_breeze_device(self._remote, **kwargs)
|
||||||
except (asyncio.TimeoutError, OSError, RuntimeError) as err:
|
except (asyncio.TimeoutError, OSError, RuntimeError) as err:
|
||||||
|
|
|
@ -98,7 +98,9 @@ class SwitcherCoverEntity(
|
||||||
|
|
||||||
try:
|
try:
|
||||||
async with SwitcherType2Api(
|
async with SwitcherType2Api(
|
||||||
self.coordinator.data.ip_address, self.coordinator.data.device_id
|
self.coordinator.data.ip_address,
|
||||||
|
self.coordinator.data.device_id,
|
||||||
|
self.coordinator.data.device_key,
|
||||||
) as swapi:
|
) as swapi:
|
||||||
response = await getattr(swapi, api)(*args)
|
response = await getattr(swapi, api)(*args)
|
||||||
except (asyncio.TimeoutError, OSError, RuntimeError) as err:
|
except (asyncio.TimeoutError, OSError, RuntimeError) as err:
|
||||||
|
|
|
@ -10,7 +10,7 @@ from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
from .const import DATA_DEVICE, DOMAIN
|
from .const import DATA_DEVICE, DOMAIN
|
||||||
|
|
||||||
TO_REDACT = {"device_id", "ip_address", "mac_address"}
|
TO_REDACT = {"device_id", "device_key", "ip_address", "mac_address"}
|
||||||
|
|
||||||
|
|
||||||
async def async_get_config_entry_diagnostics(
|
async def async_get_config_entry_diagnostics(
|
||||||
|
|
|
@ -7,5 +7,5 @@
|
||||||
"iot_class": "local_push",
|
"iot_class": "local_push",
|
||||||
"loggers": ["aioswitcher"],
|
"loggers": ["aioswitcher"],
|
||||||
"quality_scale": "platinum",
|
"quality_scale": "platinum",
|
||||||
"requirements": ["aioswitcher==3.3.0"]
|
"requirements": ["aioswitcher==3.4.1"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,9 @@ class SwitcherBaseSwitchEntity(
|
||||||
|
|
||||||
try:
|
try:
|
||||||
async with SwitcherType1Api(
|
async with SwitcherType1Api(
|
||||||
self.coordinator.data.ip_address, self.coordinator.data.device_id
|
self.coordinator.data.ip_address,
|
||||||
|
self.coordinator.data.device_id,
|
||||||
|
self.coordinator.data.device_key,
|
||||||
) as swapi:
|
) as swapi:
|
||||||
response = await getattr(swapi, api)(*args)
|
response = await getattr(swapi, api)(*args)
|
||||||
except (asyncio.TimeoutError, OSError, RuntimeError) as err:
|
except (asyncio.TimeoutError, OSError, RuntimeError) as err:
|
||||||
|
|
|
@ -368,7 +368,7 @@ aioslimproto==2.3.3
|
||||||
aiosteamist==0.3.2
|
aiosteamist==0.3.2
|
||||||
|
|
||||||
# homeassistant.components.switcher_kis
|
# homeassistant.components.switcher_kis
|
||||||
aioswitcher==3.3.0
|
aioswitcher==3.4.1
|
||||||
|
|
||||||
# homeassistant.components.syncthing
|
# homeassistant.components.syncthing
|
||||||
aiosyncthing==0.5.1
|
aiosyncthing==0.5.1
|
||||||
|
|
|
@ -341,7 +341,7 @@ aioslimproto==2.3.3
|
||||||
aiosteamist==0.3.2
|
aiosteamist==0.3.2
|
||||||
|
|
||||||
# homeassistant.components.switcher_kis
|
# homeassistant.components.switcher_kis
|
||||||
aioswitcher==3.3.0
|
aioswitcher==3.4.1
|
||||||
|
|
||||||
# homeassistant.components.syncthing
|
# homeassistant.components.syncthing
|
||||||
aiosyncthing==0.5.1
|
aiosyncthing==0.5.1
|
||||||
|
|
|
@ -26,6 +26,10 @@ DUMMY_DEVICE_ID1 = "a123bc"
|
||||||
DUMMY_DEVICE_ID2 = "cafe12"
|
DUMMY_DEVICE_ID2 = "cafe12"
|
||||||
DUMMY_DEVICE_ID3 = "bada77"
|
DUMMY_DEVICE_ID3 = "bada77"
|
||||||
DUMMY_DEVICE_ID4 = "bbd164"
|
DUMMY_DEVICE_ID4 = "bbd164"
|
||||||
|
DUMMY_DEVICE_KEY1 = "18"
|
||||||
|
DUMMY_DEVICE_KEY2 = "01"
|
||||||
|
DUMMY_DEVICE_KEY3 = "12"
|
||||||
|
DUMMY_DEVICE_KEY4 = "07"
|
||||||
DUMMY_DEVICE_NAME1 = "Plug 23BC"
|
DUMMY_DEVICE_NAME1 = "Plug 23BC"
|
||||||
DUMMY_DEVICE_NAME2 = "Heater FE12"
|
DUMMY_DEVICE_NAME2 = "Heater FE12"
|
||||||
DUMMY_DEVICE_NAME3 = "Breeze AB39"
|
DUMMY_DEVICE_NAME3 = "Breeze AB39"
|
||||||
|
@ -67,6 +71,7 @@ DUMMY_PLUG_DEVICE = SwitcherPowerPlug(
|
||||||
DeviceType.POWER_PLUG,
|
DeviceType.POWER_PLUG,
|
||||||
DeviceState.ON,
|
DeviceState.ON,
|
||||||
DUMMY_DEVICE_ID1,
|
DUMMY_DEVICE_ID1,
|
||||||
|
DUMMY_DEVICE_KEY1,
|
||||||
DUMMY_IP_ADDRESS1,
|
DUMMY_IP_ADDRESS1,
|
||||||
DUMMY_MAC_ADDRESS1,
|
DUMMY_MAC_ADDRESS1,
|
||||||
DUMMY_DEVICE_NAME1,
|
DUMMY_DEVICE_NAME1,
|
||||||
|
@ -78,6 +83,7 @@ DUMMY_WATER_HEATER_DEVICE = SwitcherWaterHeater(
|
||||||
DeviceType.V4,
|
DeviceType.V4,
|
||||||
DeviceState.ON,
|
DeviceState.ON,
|
||||||
DUMMY_DEVICE_ID2,
|
DUMMY_DEVICE_ID2,
|
||||||
|
DUMMY_DEVICE_KEY2,
|
||||||
DUMMY_IP_ADDRESS2,
|
DUMMY_IP_ADDRESS2,
|
||||||
DUMMY_MAC_ADDRESS2,
|
DUMMY_MAC_ADDRESS2,
|
||||||
DUMMY_DEVICE_NAME2,
|
DUMMY_DEVICE_NAME2,
|
||||||
|
@ -91,6 +97,7 @@ DUMMY_SHUTTER_DEVICE = SwitcherShutter(
|
||||||
DeviceType.RUNNER,
|
DeviceType.RUNNER,
|
||||||
DeviceState.ON,
|
DeviceState.ON,
|
||||||
DUMMY_DEVICE_ID4,
|
DUMMY_DEVICE_ID4,
|
||||||
|
DUMMY_DEVICE_KEY4,
|
||||||
DUMMY_IP_ADDRESS4,
|
DUMMY_IP_ADDRESS4,
|
||||||
DUMMY_MAC_ADDRESS4,
|
DUMMY_MAC_ADDRESS4,
|
||||||
DUMMY_DEVICE_NAME4,
|
DUMMY_DEVICE_NAME4,
|
||||||
|
@ -102,6 +109,7 @@ DUMMY_THERMOSTAT_DEVICE = SwitcherThermostat(
|
||||||
DeviceType.BREEZE,
|
DeviceType.BREEZE,
|
||||||
DeviceState.ON,
|
DeviceState.ON,
|
||||||
DUMMY_DEVICE_ID3,
|
DUMMY_DEVICE_ID3,
|
||||||
|
DUMMY_DEVICE_KEY3,
|
||||||
DUMMY_IP_ADDRESS3,
|
DUMMY_IP_ADDRESS3,
|
||||||
DUMMY_MAC_ADDRESS3,
|
DUMMY_MAC_ADDRESS3,
|
||||||
DUMMY_DEVICE_NAME3,
|
DUMMY_DEVICE_NAME3,
|
||||||
|
|
|
@ -25,6 +25,7 @@ async def test_diagnostics(
|
||||||
{
|
{
|
||||||
"auto_shutdown": "02:00:00",
|
"auto_shutdown": "02:00:00",
|
||||||
"device_id": REDACTED,
|
"device_id": REDACTED,
|
||||||
|
"device_key": REDACTED,
|
||||||
"device_state": {
|
"device_state": {
|
||||||
"__type": "<enum 'DeviceState'>",
|
"__type": "<enum 'DeviceState'>",
|
||||||
"repr": "<DeviceState.ON: ('01', 'on')>",
|
"repr": "<DeviceState.ON: ('01', 'on')>",
|
||||||
|
|
Loading…
Add table
Reference in a new issue