Skip to content

Commit

Permalink
Add error log to indicate a failure to find the device specified in t…
Browse files Browse the repository at this point in the history
…he configuration.
  • Loading branch information
hbeaufils committed Jan 18, 2025
1 parent d5c8820 commit cdb3cbf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion custom_components/xiaomi_cloud_map_extractor/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,12 @@ def _login(self):

def _initialize_device(self):
_LOGGER.debug("Retrieving device info, country: %s", self._country)
country, user_id, device_id, model = self._connector.get_device_details(self._token, self._country)
token = self._token
country, user_id, device_id, model = self._connector.get_device_details(token, self._country)

if device_id is None:
_LOGGER.error("Failed to find a device matching the given token: %s", token)

if model is not None:
self._country = country
_LOGGER.debug("Retrieved device model: %s", model)
Expand Down

0 comments on commit cdb3cbf

Please # to comment.