Fix duplicate attribute name in enum generator and update capabilities - #797
Closed
BrawnyBravo wants to merge 2 commits into
Closed
BrawnyBravo wants to merge 2 commits into
BrawnyBravo wants to merge 2 commits into
Conversation
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>
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.
Description:
Proposed change
The
Generate enumsworkflow has not been run since #689, so capabilities added topySmartThings/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.pyagainst current capabilities main currentlyproduces a lint failure (ruff
PIE794):samsungce.softwareVersionintroduces aplatformVersionattribute whose generated name,PLATFORM_VERSION, collides with theexisting OCF attribute
Attribute.PLATFORM_VERSION = "mnpv". The later definition wouldsilently shadow the existing member.
This PR has two commits:
"platformVersion": "SOFTWARE_PLATFORM_VERSION"to therename map in
prepare_attribute_name, the same mechanism already used for otherclashing/abbreviated names (
mnfv->OCF_FIRMWARE_VERSION,di->OCF_DEVICE_ID).The name reflects the capability it comes from.
cb4cbb3, exactly as the workflow does (generate_enums.py,ruff format src,ruff check src --fix).Compatibility
Attribute.PLATFORM_VERSIONkeeps its value"mnpv". The new attribute isAttribute.SOFTWARE_PLATFORM_VERSION = "platformVersion".Capability,AttributeorCommandmember is removed or changes value,and no existing entry in
CAPABILITY_ATTRIBUTES/CAPABILITY_COMMANDSloses an item(checked by diffing the enums and maps before and after). Existing snapshots are unchanged.
smartthingsintegration does not referenceAttribute.PLATFORM_VERSION.Added capabilities (17)
samsungce.audioMutesamsungce.bixbyAdvancedSettingssamsungce.bixbyPlaylistsamsungce.bixbyPrivacyPermissionManagementsamsungce.bixbySettingssamsungce.colorPresetsamsungce.dehumidifierDisplaysamsungce.statefulLampsamsungvd.tvChannelstse.invisibleCapabilitiesabateachieve62503.statelessFanspeedDecreaseabateachieve62503.statelessFanspeedIncreaseabateachieve62503.statelessPowerOffabateachieve62503.statelessPowerOnlegendabsolute60149.atmPressureRateChangeorangebrook39927.virtualFactoryorangebrook39927.virtualInventoryExisting 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 arenot yet in the capabilities repo).
Testing
pytest: 112 passed, 100 snapshots passed, no snapshot changes.pre-commit-hooks checks all pass.
script/generate_enums.py, so no test wasadded 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:
.coveragercallowedscript/generate_enums.pyhas no test coverage today, and the generated enums don't change any snapshot. Happy to add a test if you'd like one.README.MDupdated (if necessary) - not necessary.🤖 Generated with Claude Code