Skip to content

Commit 9db5aaf

Browse files
authored
Bump yalexs to 9.1.0 (home-assistant#152457)
1 parent 64cdcfb commit 9db5aaf

File tree

6 files changed

+51
-4
lines changed

6 files changed

+51
-4
lines changed

homeassistant/components/august/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929
"documentation": "https://www.home-assistant.io/integrations/august",
3030
"iot_class": "cloud_push",
3131
"loggers": ["pubnub", "yalexs"],
32-
"requirements": ["yalexs==9.0.1", "yalexs-ble==3.1.2"]
32+
"requirements": ["yalexs==9.1.0", "yalexs-ble==3.1.2"]
3333
}

homeassistant/components/yale/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
"documentation": "https://www.home-assistant.io/integrations/yale",
1414
"iot_class": "cloud_push",
1515
"loggers": ["socketio", "engineio", "yalexs"],
16-
"requirements": ["yalexs==9.0.1", "yalexs-ble==3.1.2"]
16+
"requirements": ["yalexs==9.1.0", "yalexs-ble==3.1.2"]
1717
}

requirements_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements_test_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/components/august/mocks.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@
4848

4949
USER_ID = "a76c25e5-49aa-4c14-cd0c-48a6931e2081"
5050

51+
# Default capabilities for locks
52+
_DEFAULT_CAPABILITIES = {
53+
"unlatch": False,
54+
"doorSense": True,
55+
"batteryType": "AA",
56+
}
57+
5158

5259
def _mock_get_config(
5360
brand: Brand = Brand.YALE_AUGUST, jwt: str | None = None
@@ -342,6 +349,15 @@ async def make_mock_api(
342349
api_instance.async_unlatch_async = AsyncMock()
343350
api_instance.async_unlatch = AsyncMock()
344351

352+
# Mock capabilities endpoint
353+
async def mock_get_lock_capabilities(token, serial_number):
354+
"""Mock the capabilities endpoint response."""
355+
return {"lock": _DEFAULT_CAPABILITIES}
356+
357+
api_instance.async_get_lock_capabilities = AsyncMock(
358+
side_effect=mock_get_lock_capabilities
359+
)
360+
345361
return api_instance
346362

347363

tests/components/yale/mocks.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,27 @@
4848

4949
USER_ID = "a76c25e5-49aa-4c14-cd0c-48a6931e2081"
5050

51+
# Define lock capabilities for specific locks
52+
_LOCK_CAPABILITIES = {
53+
"online_with_unlatch": {
54+
"unlatch": True,
55+
"doorSense": True,
56+
"batteryType": "AA",
57+
},
58+
"68895DD075A1444FAD4C00B273EEEF28": { # Also online_with_unlatch
59+
"unlatch": True,
60+
"doorSense": True,
61+
"batteryType": "AA",
62+
},
63+
}
64+
65+
# Default capabilities for locks not in the dict
66+
_DEFAULT_CAPABILITIES = {
67+
"unlatch": False,
68+
"doorSense": True,
69+
"batteryType": "AA",
70+
}
71+
5172

5273
def _mock_get_config(
5374
brand: Brand = Brand.YALE_GLOBAL, jwt: str | None = None
@@ -340,6 +361,16 @@ async def make_mock_api(
340361
api_instance.async_unlatch = AsyncMock()
341362
api_instance.async_add_websocket_subscription = AsyncMock()
342363

364+
# Mock capabilities endpoint
365+
async def mock_get_lock_capabilities(token, serial_number):
366+
"""Mock the capabilities endpoint response."""
367+
capabilities = _LOCK_CAPABILITIES.get(serial_number, _DEFAULT_CAPABILITIES)
368+
return {"lock": capabilities}
369+
370+
api_instance.async_get_lock_capabilities = AsyncMock(
371+
side_effect=mock_get_lock_capabilities
372+
)
373+
343374
return api_instance
344375

345376

0 commit comments

Comments
 (0)