mirror of
https://github.com/sudoxnym/roomba_rest980.git
synced 2026-04-14 11:37:46 +00:00
remove debug feat
This commit is contained in:
parent
a74b846bc2
commit
87a51117b3
2 changed files with 1 additions and 47 deletions
|
|
@ -444,9 +444,6 @@ class iRobotCloudApi:
|
|||
|
||||
umf_data = await self._aws_request(url, params)
|
||||
|
||||
# Save UMF data for debugging/camera development
|
||||
await self._save_umf_data_for_debug(pmap_id, umf_data)
|
||||
|
||||
return umf_data
|
||||
|
||||
async def get_favorites(self) -> dict[str, Any]:
|
||||
|
|
@ -502,49 +499,6 @@ class iRobotCloudApi:
|
|||
all_data["favorites"] = await self.get_favorites()
|
||||
return all_data
|
||||
|
||||
async def _save_umf_data_for_debug(
|
||||
self, pmap_id: str, umf_data: dict[str, Any]
|
||||
) -> None:
|
||||
"""Save UMF data to file for debugging purposes."""
|
||||
if not DEBUG_SAVE_UMF:
|
||||
return
|
||||
|
||||
try:
|
||||
# Create debug data structure
|
||||
debug_data = {
|
||||
"timestamp": datetime.now(UTC).isoformat(),
|
||||
"pmap_id": pmap_id,
|
||||
"umf_data": umf_data,
|
||||
}
|
||||
|
||||
# Load existing data if file exists
|
||||
existing_data = []
|
||||
if DEBUG_UMF_PATH.exists():
|
||||
try:
|
||||
async with aiofiles.open(DEBUG_UMF_PATH) as f:
|
||||
content = await f.read()
|
||||
existing_data = json.loads(content)
|
||||
if not isinstance(existing_data, list):
|
||||
existing_data = [existing_data]
|
||||
except (json.JSONDecodeError, OSError):
|
||||
existing_data = []
|
||||
|
||||
# Add new data
|
||||
existing_data.append(debug_data)
|
||||
|
||||
# Keep only the latest 10 entries to avoid huge files
|
||||
if len(existing_data) > 10:
|
||||
existing_data = existing_data[-10:]
|
||||
|
||||
# Save back to file
|
||||
async with aiofiles.open(DEBUG_UMF_PATH, "w") as f:
|
||||
await f.write(json.dumps(existing_data, indent=2, default=str))
|
||||
|
||||
_LOGGER.debug("Saved UMF data for pmap %s to %s", pmap_id, DEBUG_UMF_PATH)
|
||||
|
||||
except (OSError, json.JSONEncodeError) as e:
|
||||
_LOGGER.warning("Failed to save UMF debug data: %s", e)
|
||||
|
||||
|
||||
"""
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"codeowners": [
|
||||
"@ia74"
|
||||
],
|
||||
"version": "1.5.0",
|
||||
"version": "1.5.1",
|
||||
"config_flow": true,
|
||||
"dependencies": [],
|
||||
"dhcp": [
|
||||
|
|
|
|||
Loading…
Reference in a new issue