-
-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Expose the condition code on condition sensors #14011
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -131,9 +131,12 @@ def entity_picture(self): | |
| @property | ||
| def device_state_attributes(self): | ||
| """Return the state attributes.""" | ||
| return { | ||
| ATTR_ATTRIBUTION: CONF_ATTRIBUTION, | ||
| } | ||
| attrs = { ATTR_ATTRIBUTION: CONF_ATTRIBUTION } | ||
|
|
||
| if self._code is None or "weather" in self._type: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the attribute added always (
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. Only the weather condition version of this sensor should have condition code since it doesn’t make much sense for the temp sensor to have it. This follows the pattern of
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you want to follow that pattern, you should check for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I blew this, copying the pattern for returning None lol. Late night PRs. I’ll fix it later today. Thanks. |
||
| attrs['condition_code'] = self._code | ||
|
|
||
| return attrs | ||
|
|
||
| def update(self): | ||
| """Get the latest data from Yahoo! and updates the states.""" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace after '{'
whitespace before '}'