feat: log unmatched product ids for configured devices#5573
Merged
Conversation
Second increment for make-all#5526 (builds on make-all#5532). Adds a periodic (~10 min) product scan to the discovery service: for each configured device it looks up the product id via tinytuya.find_device and, when that id is not listed in the device's config file (products:), logs a WARNING once per device per HA start so the config can be improved. Adds TuyaDeviceConfig.matches_product() and tests. The fast IP-rediscovery sweep from make-all#5532 is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
make-all
pushed a commit
that referenced
this pull request
Jul 18, 2026
Third increment for #5526. Extends the discovery service's periodic scan to a single tinytuya.deviceScan that (a) checks product ids for configured devices (folding in the per-device check from #5573) and (b) raises an integration_discovery flow for each unconfigured device found, so it surfaces in Home Assistant for one-click setup with the built-in per-unique_id ignore. Adds ConfigFlowHandler.async_step_integration_discovery, which reuses the existing manual-setup prefill (id/ip/version from discovery; the user supplies the local key) and aborts if the device is already configured or ignored. Keyed on gwId. The fast IP-rediscovery sweep from #5532 is unchanged. Co-authored-by: neneonline <2820882+neneonline@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second increment for #5526, building on the merged #5532.
Implements the issue item: "logging of product ids for already configured devices where the config file does not have a match (to allow improvement of configs)."
What it does
product_idviatinytuya.find_device(...)(the same call feat: auto-update device IP via background LAN rediscovery #5532 uses for IP rediscovery). If that id is not listed in the device's config file underproducts:, it logs one WARNING per device per HA start:<device>: device product id <id> is not listed in its config (<config>); please report it so support can be improvedTuyaDeviceConfig.matches_product(product_id).Scope / follow-ups
Coverage comes from the periodic scan (first pass ~10 min after start). The remaining #5526 items (a
deviceScan-based pass that surfaces unknown devices as discovery notifications with an ignore option, and a startup trigger) are the next PR. Kept separate to keep this one small and reviewable.Tests
tests/test_discovery.pyadds cases for: warn-once on an unmatched product id (and no repeat on a second scan), silence when it matches, skip when no product id is reported, and graceful handling of a missing config.uv run pytest(397 passed) andruff check/ruff format --checkare green.