Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ test.py
# rust so
*.cpython*.so

.codspeed
.codspeed
models_map.json
1 change: 1 addition & 0 deletions deebot_client/hardware/deebot/34vhpm.py
1 change: 1 addition & 0 deletions deebot_client/hardware/deebot/cuoipb.py
10 changes: 10 additions & 0 deletions scripts/check_for_similar_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
from __future__ import annotations

import asyncio
import json
import logging
import os
from pathlib import Path
import time

import aiohttp
Expand All @@ -15,6 +17,12 @@
from deebot_client.util import md5


def _save_models(models_map: dict[str, list[str]]) -> None:
"""Save models to file."""
with Path("models_map.json").open("w") as f:
f.write(json.dumps(models_map, indent=4))


async def main() -> None:
"""Execute script."""
async with aiohttp.ClientSession() as session:
Expand All @@ -34,6 +42,8 @@ async def main() -> None:
for key, value in (await api_client.get_product_iot_map()).items():
name_map.setdefault(value["name"], []).append(key)

await asyncio.get_event_loop().run_in_executor(None, _save_models, name_map)

# Load current models
await asyncio.get_event_loop().run_in_executor(None, _load)

Expand Down