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

Fixed the range filter unknown argument precision #19428

Merged
merged 1 commit into from Dec 20, 2018

Conversation

Projects
None yet
3 participants
@timkoers
Copy link
Contributor

timkoers commented Dec 18, 2018

In HomeAssistant 0.84.3, the range filter would not work due to the unexpected precision filter parameter.
The default range scheme has been edited to remove the unexpected precision parameter.

Verified and tested.

Description:

A bug that caused the filter platform to crash when using the range filter.

Related issue (if applicable): fixes #0.84.3

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#19428

Example entry for configuration.yaml (if applicable):

  - platform: filter
    name: "Test"
    entity_id: sensor.test_sensor
    filters:
      - filter: range
        lower_bound: 0
        upper_bound: 1187
      - filter: lowpass
        precision: 1
        time_constant: 10

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.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
Fixed the range filter unknown argument precision
In HomeAssistant 0.84.3, the range filter would not work due to the unexpected precision filter parameter. 
The default range scheme has been edited to remove the unexpected precision parameter.

Verified and tested.

@timkoers timkoers requested a review from dgomes as a code owner Dec 18, 2018

@homeassistant

This comment has been minimized.

Copy link

homeassistant commented Dec 18, 2018

Hi @timkoers,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@dgomes

This comment has been minimized.

Copy link
Member

dgomes commented Dec 18, 2018

Hi!

Can you detail a bit more on the issue at hand ?

CONF_FILTER_PRECISION is Optional, it should not interfere

@timkoers

This comment has been minimized.

Copy link
Contributor

timkoers commented Dec 18, 2018

I'd love to sent you a stacktrace of the exception, but I don't have it anymore. The issue was that the filter component could not be setup, because there was an optional parameter in the parameters list, that range did not need and expect.
Apparently that made the component crash and when I fixed it, it worked like expected.

@dgomes

This comment has been minimized.

Copy link
Member

dgomes commented Dec 18, 2018

It would be really important to correctly trace that situation and add a test

@timkoers

This comment has been minimized.

Copy link
Contributor

timkoers commented Dec 18, 2018

I remember that the unexpected parameter exception was thrown in filter.py on line 124 (async_setup_platform). I could restart my server with the fix commented out if you really need the full stack, but I'm not really wanting to do that.

@dgomes dgomes merged commit c789f11 into home-assistant:dev Dec 20, 2018

5 checks passed

Hound No violations found. Woof!
WIP Legacy commit status override — see details
Details
cla-bot All contributors have signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.009%) to 93.033%
Details

@wafflebot wafflebot bot removed the in progress label Dec 20, 2018

@dgomes
Copy link
Member

dgomes left a comment

Validated

Thanks!

@timkoers timkoers deleted the timkoers:patch-1 branch Dec 24, 2018

@balloob balloob referenced this pull request Jan 10, 2019

Merged

0.85.0 #19897

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment