Exclude filter for event types#7627
Merged
Merged
Conversation
|
@amigian74, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob, @rhooper and @kellerza to be potential reviewers. |
houndci-bot
reviewed
May 17, 2017
| session.add(dbevent) | ||
|
|
||
| if event.event_type == EVENT_STATE_CHANGED: | ||
| if event.event_type == EVENT_STATE_CHANGED and EVENT_STATE_CHANGED not in self.exclude_t: |
There was a problem hiding this comment.
line too long (105 > 79 characters)
balloob
requested changes
May 18, 2017
Member
balloob
left a comment
There was a problem hiding this comment.
Will also require tests to be written.
| with session_scope(session=self.get_session()) as session: | ||
| dbevent = Events.from_event(event) | ||
| session.add(dbevent) | ||
| dbevent = None |
Member
There was a problem hiding this comment.
This is not the correct way to filter out the event. Have a look at the above examples on how things get filtered.
add test for exclude event types
houndci-bot
reviewed
May 19, 2017
| hass = hass_recorder({'exclude': {'event_types': 'test'}}) | ||
| events = _add_events(hass, {'test': 'nothing', 'test2': 'something'}) | ||
| assert len(events) == 1 | ||
| #assert hass.e.get('test2.recorder') == states[0] |
There was a problem hiding this comment.
block comment should start with '# '
balloob
reviewed
May 23, 2017
| continue | ||
|
|
||
| with session_scope(session=self.get_session()) as session: | ||
| dbevent = None |
Member
There was a problem hiding this comment.
This is still way too difficult. Just add this elif event.event_type == EVENT_TIME_CHANGED::
if event.event_type in self.exclude_t:
self.queue.task_done()
continue
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:
We are using an SD Card as persitent memory on our system. Extensive write operations killing these cards in a few months. Therefore it should be possible to exclude events just like states from being persisted into the database.
With this change events can be excluded from being persisted. If 'state_change' is excluded states won't be persisted too.
Example entry for
configuration.yaml: