Skip to content

feat(pim): serve product info from config data - #252

Open
hoshsadiq wants to merge 1 commit into
MVladislav:mainfrom
hoshsadiq:feat/product-info
Open

hoshsadiq wants to merge 1 commit into
MVladislav:mainfrom
hoshsadiq:feat/product-info

Conversation

@hoshsadiq

@hoshsadiq hoshsadiq commented Jul 31, 2026 •

Copy link
Copy Markdown

Description

The app device setup wizard queries /product/info for model details. Bumper had no handler, so the wizard stalled. Uses the responses from existing configNetAll and productIotMap data instead of hardcoding per-model entries.

Also fixes stale entries in the static config files.

I'm unsure about the changes in get_product_entry_group(). The new app refuses to work properly without that change. Also unsure how best to address it and test it with an older version I guess.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (changes to documentation only)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

  • Unit tests
  • Integration tests
  • Manual testing

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

The app device setup wizard queries /product/info for model details.
Bumper had no handler, so the wizard stalled. Reuses responses
from existing configNetAll and productIotMap data instead of
hardcoding per-model entries.

Also fixes stale entries in the static config files.
@MVladislav

Copy link
Copy Markdown
Owner

hey, nice one! a few notes from my side:

static jsons - pls don't edit manually

bumper/web/static_api/configNetAllResponse.json and
bumper/web/static_api/productIotMap.json are a one-to-one download from ecovacs via
scripts/eco-json-downloader.sh (see the ["pim/product/getConfignetAll"]="configNetAllResponse" /
["pim/product/getProductIotMap"]="productIotMap" mappings). any manual edits (the t20 omni
mid/materialNo fix, the DARWIN_OMNI video: false) would just get overwritten on the next
refresh - the json is a plain download, it is what the source gives us.

if something is missing or needs to be changed in that data, that can't be fixed in the script or
in code. the solution is the matching *Unofficial.json files
(configNetAllResponseUnofficial.json, productIotMapUnofficial.json, ...): they get merged with
the official ones at load time in bumper/web/static_api/__init__.py (load_json_array_files) and
the downloader won't touch them.

also heads up: the downloader script itself is getting a rework in #268 -
scripts/eco-json-downloader.sh is renamed to scripts/update-eco-data.sh, with a device
verification flow and deterministic combination (country priority, normalized key order). there's
also a new maintenance doc explaining the whole update flow:
docs/development/static-data-update.md - if you need to refresh the data or look into how it
works, use the new script and read the doc.

The merging part with Unofficial.json is not deep tested, and the combination logic between the official and the
Unofficial.json files may need some improvement to get the best possible result. so don't treat the
current merge behavior as final.

The get_product_entry_group() change (object → array loader) looks good and valid to me.

old vs new app

there is no planning right now for supporting both old and new app versions.
if someone actually needs old app support, we can open a discussion for it, but for now it's just
research to do the best possible job on this part. main focus is bots, api and mqtt working,
especially in combination with home assistant - the app is just a nice bonus feature.

ruff

PERF401 at bumper/web/static_api/__init__.py:125:

for mid in mids:
    if robot := lookup.get(mid):
        result.append(_robot_to_product_info(robot))
return result

just make it a list comprehension:

return [
    _robot_to_product_info(robot)
    for mid in mids
    if (robot := lookup.get(mid))
]

Please also include a python test case for the new api (GET /product/info) - the endpoint is
currently untested, would be nice to have one (or a few) test covering the lookup, incl. unknown mids.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants