Merge of nested IF-IF cases - A-C (#48365)
This commit is contained in:
parent
8d5ce53098
commit
db355f9b23
7 changed files with 34 additions and 32 deletions
|
@ -349,12 +349,18 @@ def _device_already_added(current_entries, user_input, protocol):
|
|||
entry_path = entry.data.get(CONF_DEVICE_PATH)
|
||||
entry_baud = entry.data.get(CONF_DEVICE_BAUD)
|
||||
|
||||
if protocol == PROTOCOL_SOCKET:
|
||||
if user_host == entry_host and user_port == entry_port:
|
||||
return True
|
||||
if (
|
||||
protocol == PROTOCOL_SOCKET
|
||||
and user_host == entry_host
|
||||
and user_port == entry_port
|
||||
):
|
||||
return True
|
||||
|
||||
if protocol == PROTOCOL_SERIAL:
|
||||
if user_baud == entry_baud and user_path == entry_path:
|
||||
return True
|
||||
if (
|
||||
protocol == PROTOCOL_SERIAL
|
||||
and user_baud == entry_baud
|
||||
and user_path == entry_path
|
||||
):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue