Skip to content

Allow Z-Wave devices without manufacturer and product ids - #821

Merged
joostlek merged 1 commit into
pySmartThings:mainfrom
cristianchiriac:zwave-optional-product-ids
Oct 27, 2026
Merged

joostlek merged 1 commit into
pySmartThings:mainfrom
cristianchiriac:zwave-optional-product-ids

Conversation

@cristianchiriac

Copy link
Copy Markdown
Contributor

Description:

Since #784 (released with Home Assistant 2026.10), Zwave.manufacturer_id, product_type and product_id are required. SmartThings leaves these keys out of the zwave block for some devices, for example when secure inclusion failed ("networkSecurityLevel": "ZWAVE_S0_FAILED"). get_devices() then fails for the whole location:

mashumaro.exceptions.MissingField: Field "manufacturer_id" of type int is missing in Zwave instance
mashumaro.exceptions.InvalidFieldValue: Field "zwave" of type Optional[Zwave] in Device has invalid value {'networkId': '02', ..., 'networkSecurityLevel': 'ZWAVE_S0_FAILED', 'provisioningState': 'PROVISIONED'}

In Home Assistant this stops the SmartThings integration from setting up: home-assistant/core#184789.

The three fields are now int | None with a default of None. network_id is still required.

I added tests/fixtures/devices_19.json with a Z-Wave device whose zwave block has the shape from the HA report (no manufacturer/product ids), added it to test_fetching_devices, and generated its snapshot. The test fails with the error above without the model change.

Related issue (if applicable): home-assistant/core#184789

Checklist:

  • The code change is tested and works locally.
  • Local tests pass. (pytest: 113 passed; ruff, ruff format, mypy and prettier clean)
  • There is no commented out code in this PR.
  • Tests have been added/updated and code coverage percentage does not drop. No exclusions in .coveragerc allowed
  • README.MD updated (if necessary) (not needed)

SmartThings leaves manufacturerId, productType and productId out of the
zwave block for some devices, e.g. when secure inclusion failed
(networkSecurityLevel ZWAVE_S0_FAILED). Since the fields were added as
required, get_devices() fails for every location with such a device.
@joostlek joostlek added the bugfix Inconsistencies or issues which will cause a problem for users or implementers. label Oct 27, 2026
@joostlek
joostlek merged commit bc4de6d into pySmartThings:main Oct 27, 2026
10 of 12 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bugfix Inconsistencies or issues which will cause a problem for users or implementers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants