Skip to content

Commit

Permalink
Fix MacAddressMismatchError check for RPC devices (#715)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecode authored Nov 17, 2024
1 parent 7105bec commit 503d43c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions aioshelly/rpc_device/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,11 @@ async def _init_calls(self) -> None:
self.options.password,
)

mac = self.shelly["mac"]
device_mac = self.options.device_mac
if device_mac and device_mac != mac:
raise MacAddressMismatchError(f"Input MAC: {device_mac}, Shelly MAC: {mac}")

calls: list[tuple[str, dict[str, Any] | None]] = [("Shelly.GetConfig", None)]
if fetch_status := self._status is None:
calls.append(("Shelly.GetStatus", None))
Expand Down

0 comments on commit 503d43c

Please sign in to comment.