Adding source attribute to geo location platforms#17339
Merged
balloob merged 3 commits intohome-assistant:devfrom Oct 12, 2018
Merged
Adding source attribute to geo location platforms#17339balloob merged 3 commits intohome-assistant:devfrom
balloob merged 3 commits intohome-assistant:devfrom
Conversation
balloob
reviewed
Oct 12, 2018
homeassistant/const.py
Outdated
| ATTR_OPTION = 'option' | ||
|
|
||
| # For entities which have a source they want to specify. | ||
| ATTR_SOURCE = 'source' |
balloob
reviewed
Oct 12, 2018
| @property | ||
| def source(self) -> Optional[str]: | ||
| """Return source value of this external event.""" | ||
| return None |
Member
There was a problem hiding this comment.
Let's make this mandatory by raising NotImplementedError
I don't want the automation trigger to not be able to work on all geo platforms.
exxamalte
added a commit
to exxamalte/home-assistant
that referenced
this pull request
Oct 13, 2018
7 tasks
MartinHjelmare
pushed a commit
that referenced
this pull request
Oct 14, 2018
* initial integration with nsw rural fire service feed * improved test coverage * updated requirements * grouped imports * removed debug print statement * moved manager's startup code into separate call * simplified feed update code * simplified feed update code * simplified device state attribute code * added source to conform with pr #17339 * fixed lint * refactored how entities are managed * fixed pylint * simplified signalling
Merged
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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:
This adds a
sourceattribute to the existinggeo_locationplatforms. The purpose of this change is to make entities generated by these platforms identifiable for the newgeo_locationtrigger.Each new platform will need to override the
sourcemethod in its own sub-class ofGeoLocationEvent, so that the value is automatically added by thestate_attributesmethod.Related issue (if applicable): prerequisite for #16967
Pull request in home-assistant.io with documentation (if applicable): n/a
Example entry for
configuration.yaml(if applicable): n/aChecklist:
tox. Your PR cannot be merged unless tests passIf the code does not interact with devices: