Skip to content

Commit 1b2de51

Browse files
authored
fix: remove raise in SwitcherBreezeRemoteManager init (#586)
Signed-off-by: Shay Levy <[email protected]> Signed-off-by: Shay Levy <[email protected]>
1 parent 611f824 commit 1b2de51

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

src/aioswitcher/api/remotes.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from binascii import hexlify
1919
from json import load
2020
from logging import getLogger
21-
from os import path
2221
from pathlib import Path
2322
from typing import Any, Dict, List, Union, final
2423

@@ -418,11 +417,6 @@ def __init__(self, remotes_db_path: str = BREEZE_REMOTE_DB_FPATH) -> None:
418417
"""Initialize the Remote manager."""
419418
self._remotes_db: Dict[str, SwitcherBreezeRemote] = {}
420419
self._remotes_db_fpath = remotes_db_path
421-
# verify the file exists
422-
if not path.isfile(self._remotes_db_fpath):
423-
raise OSError(
424-
f"The specified remote db path {self._remotes_db_fpath} does not exist"
425-
)
426420

427421
def get_remote(self, remote_id: str) -> SwitcherBreezeRemote:
428422
"""Get Breeze remote by the remote id.

tests/test_api_tcp_client.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,12 +307,6 @@ async def test_breeze_get_command_function_should_raise_command_does_not_eixst(r
307307
assert_that(command.command).is_equal_to(hexlify(elec7001_turn_off_cmd).decode())
308308

309309

310-
async def test_breeze_remote_manager_with_none_existing_remotes_db():
311-
local_remotes_db = "/wrong/directory/remotes_db.json"
312-
with raises(OSError, match=f"The specified remote db path {local_remotes_db} does not exist"):
313-
SwitcherBreezeRemoteManager(local_remotes_db)
314-
315-
316310
async def test_breeze_remote_manager_get_from_local_database():
317311
remote_manager = SwitcherBreezeRemoteManager()
318312
remote_7022 = remote_manager.get_remote("ELEC7022")

0 commit comments

Comments
 (0)