Skip to content

Fix duplicate attribute name in enum generator and update capabilities - #797

Closed
BrawnyBravo wants to merge 2 commits into
pySmartThings:mainfrom
BrawnyBravo:fix/generate-enums-duplicate-attribute
Closed

BrawnyBravo wants to merge 2 commits into
pySmartThings:mainfrom
BrawnyBravo:fix/generate-enums-duplicate-attribute

Conversation

@BrawnyBravo

Copy link
Copy Markdown

Description:

Proposed change

The Generate enums workflow has not been run since #689, so capabilities added to
pySmartThings/capabilities in pySmartThings/capabilities#52
(2026-07-13) are still unknown to pysmartthings and Home Assistant logs
Unknown capability ... warnings for them.

Re-running script/generate_enums.py against current capabilities main currently
produces a lint failure (ruff PIE794): samsungce.softwareVersion introduces a
platformVersion attribute whose generated name, PLATFORM_VERSION, collides with the
existing OCF attribute Attribute.PLATFORM_VERSION = "mnpv". The later definition would
silently shadow the existing member.

This PR has two commits:

  1. Generator fix - add "platformVersion": "SOFTWARE_PLATFORM_VERSION" to the
    rename map in prepare_attribute_name, the same mechanism already used for other
    clashing/abbreviated names (mnfv -> OCF_FIRMWARE_VERSION, di -> OCF_DEVICE_ID).
    The name reflects the capability it comes from.
  2. Update capabilities - enums regenerated from pySmartThings/capabilities
    cb4cbb3, exactly as the workflow does (generate_enums.py, ruff format src,
    ruff check src --fix).

Compatibility

  • Attribute.PLATFORM_VERSION keeps its value "mnpv". The new attribute is
    Attribute.SOFTWARE_PLATFORM_VERSION = "platformVersion".
  • No existing Capability, Attribute or Command member is removed or changes value,
    and no existing entry in CAPABILITY_ATTRIBUTES / CAPABILITY_COMMANDS loses an item
    (checked by diffing the enums and maps before and after). Existing snapshots are unchanged.
  • Home Assistant core's smartthings integration does not reference
    Attribute.PLATFORM_VERSION.

Added capabilities (17)

  • samsungce.audioMute
  • samsungce.bixbyAdvancedSettings
  • samsungce.bixbyPlaylist
  • samsungce.bixbyPrivacyPermissionManagement
  • samsungce.bixbySettings
  • samsungce.colorPreset
  • samsungce.dehumidifierDisplay
  • samsungce.statefulLamp
  • samsungvd.tvChannel
  • stse.invisibleCapabilities
  • abateachieve62503.statelessFanspeedDecrease
  • abateachieve62503.statelessFanspeedIncrease
  • abateachieve62503.statelessPowerOff
  • abateachieve62503.statelessPowerOn
  • legendabsolute60149.atmPressureRateChange
  • orangebrook39927.virtualFactory
  • orangebrook39927.virtualInventory

Existing capabilities whose definitions gained attributes/commands are updated as well
(87 attributes and 52 commands added in total; nothing removed).

Related issues

Fixes #744, fixes #757, fixes #778. Partially addresses #779 and #725 (the bixby /
audioMute capabilities are covered; other samsungce.* capabilities listed there are
not yet in the capabilities repo).

Testing

  • pytest: 112 passed, 100 snapshots passed, no snapshot changes.
  • ruff check / format, mypy, pylint, codespell, yamllint, prettier and the
    pre-commit-hooks checks all pass.
  • Regeneration is reproducible: running the generator again on this branch gives no diff.
  • There is no existing test coverage for script/generate_enums.py, so no test was
    added for the rename; the lint step in the workflow is what catches such clashes.

Related issue (if applicable): fixes #744, fixes #757, fixes #778 (partially addresses #779 and #725)

Checklist:

  • The code change is tested and works locally.
  • Local tests pass.
  • 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
    • Not applicable as far as I can tell: script/generate_enums.py has no test coverage today, and the generated enums don't change any snapshot. Happy to add a test if you'd like one.
  • README.MD updated (if necessary) - not necessary.

🤖 Generated with Claude Code

BrawnyBravo and others added 2 commits September 13, 2026 13:07
samsungce.softwareVersion defines a platformVersion attribute whose
generated name collides with the existing ocf mnpv attribute
(Attribute.PLATFORM_VERSION), which makes ruff fail with PIE794.
Map platformVersion to SOFTWARE_PLATFORM_VERSION so the existing
member keeps its name and value.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sync the capabilities with the SmartThings API (pySmartThings/capabilities
cb4cbb3), generated with script/generate_enums.py as in the Generate enums
workflow.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@joostlek joostlek closed this Sep 19, 2026
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.

Recurrent messages on HA logs unknow capability Unknown capabilities: samsungce.bixbySettings, samsungce.audioMute, and others

2 participants