Skip to content

Commit

Permalink
chore(nexa): enforce system type check
Browse files Browse the repository at this point in the history
  • Loading branch information
andersevenrud committed Apr 11, 2024
1 parent 0aaba0a commit d4bf416
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions custom_components/nexa_bridge_x/nexa.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,18 +314,12 @@ async def test_connection(self) -> NexaInfoData:
if key not in result:
raise NexaApiNotCompatibleError("Device response invalid")

if result["systemType"] not in ["Bridge1", "Bridge2"]:
raise NexaApiNotCompatibleError("Device system not compatible")

#check_type = self.legacy and "Bridge1" or "Bridge2"
#check_ver = self.legacy and "1" or "2"
#
#if result["systemType"] != check_type:
# raise NexaApiNotCompatibleError("Device system not compatible")
#
# TODO: Add semver check in the future if there are firmware diffs
#if not str(result["version"]).startswith(check_ver):
# raise NexaApiNotCompatibleError("Endpoint not compatible")
if self.legacy:
if result["systemType"] != "Bridge1":
raise NexaApiNotCompatibleError("Endpoint not compatible")
else:
if result["systemType"] != "Bridge2":
raise NexaApiNotCompatibleError("Endpoint not compatible")

return result

Expand Down

0 comments on commit d4bf416

Please sign in to comment.