Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add id (sgtin) to state attributes #26086

Merged
merged 1 commit into from Aug 20, 2019

Conversation

@sander76
Copy link
Contributor

commented Aug 20, 2019

Description:

The sgtin of a homematic device is the real unique identifier of a specific device.
This PR adds the sgtin to the state attributes (like the non-cloud homematic implementation has too).
This allows for easier identification of individual devices in hass.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the [development checklist][dev-checklist]
@@ -93,7 +94,8 @@ def icon(self) -> Optional[str]:
@property
def device_state_attributes(self):
"""Return the state attributes of the generic device."""
attr = {ATTR_MODEL_TYPE: self._device.modelType}
attr = {ATTR_MODEL_TYPE: self._device.modelType, ATTR_ID: self._device.id}

This comment has been minimized.

Copy link
@balloob

balloob Aug 20, 2019

Member

If it's a real unique ID, why would unique ID include the class name ?

This comment has been minimized.

Copy link
@sander76

sander76 Aug 20, 2019

Author Contributor

@balloob "my" ID refers to a physical device with a unique sgtin/id. I think the unique id you refer to is a unique hass device type belonging to that physical device. But there can be more of those all pointing to that one physical device.

This comment has been minimized.

Copy link
@sander76

sander76 Aug 20, 2019

Author Contributor

@balloob The description in my PR should have better described that I guess

@sander76
Copy link
Contributor Author

left a comment

@balloob "my" ID refers to a physical device with a unique sgtin/id. I think the unique id you refer to is a unique hass device type belonging to that physical device. But there can be more of those all pointing to that one physical device.

Dev automation moved this from Needs review to Reviewer approved Aug 20, 2019

@balloob balloob merged commit f34b84a into home-assistant:dev Aug 20, 2019

12 checks passed

CI Build #20190820.19 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch Coverage not affected when comparing c5ca431...ed3ed70
Details
codecov/project 94% (target 90%)
Details
docs-missing Documentation ok.

Dev automation moved this from Reviewer approved to Done Aug 20, 2019

@lock lock bot locked and limited conversation to collaborators Aug 21, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
3 participants
You can’t perform that action at this time.