Skip to content

components.knx - KNXMultiAddressDevice corrections#8275

Merged
balloob merged 1 commit into
home-assistant:devfrom
tiktok7:fix-base-knx-component
Jul 1, 2017
Merged

components.knx - KNXMultiAddressDevice corrections#8275
balloob merged 1 commit into
home-assistant:devfrom
tiktok7:fix-base-knx-component

Conversation

@tiktok7
Copy link
Copy Markdown
Contributor

@tiktok7 tiktok7 commented Jul 1, 2017

During the course of debugging some KNX implementations I've noticed and tried to correct a number of basic problems with the components/knx.py file.

  1. The has_attributes was comparing names to addresses
  2. Some errors outside of an except block were using
    _LOGGER.except. This will cause an exception itself because there is no
    trance context available to the logger
  3. Added alias names for the address and state addresses so that they
    can be accessed with the same interface as other XXX_address channels
    via value() and set_value()
  4. Added return values for the set_int_value and set_percentage methods
    to allow error checking similar to the set_value method
  5. Added the name of the configured object to the log messages to make
    them more meaningful (otherwise multiple similar log messages are
    received without any hint as to the target device)

Description:

Related issue (if applicable): fixes #

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>

Example entry for configuration.yaml (if applicable):

Checklist:

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

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

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

1. The has_attributes was comparing names to addresses
2. Some errors outside of an except block were using
_LOGGER.except. This will cause an exception itself because there is no
trance context available to the logger
3. Added alias names for the address and state addresses so that they
can be accessed with the same
4. Added return values for the set_int_value and set_percentage methods
to allow error checking similar to the set_value method
5. Added the name of the configured object to the log messages to make
them more meaningful (otherwise multiple similar log messages are
received without any hint as to the target device)
@mention-bot
Copy link
Copy Markdown

@tiktok7, thanks for your PR! By analyzing the history of the files in this pull request, we identified @usul27, @fabaff and @open-homeautomation to be potential reviewers.

@tiktok7
Copy link
Copy Markdown
Contributor Author

tiktok7 commented Jul 1, 2017

@balloob : the travis-ci build fails for py3.6 but it looks like a generic problem with the build. I couldn't see anything specific to my change in there. If there's something I need to do, can you give me a hint please?

@balloob
Copy link
Copy Markdown
Member

balloob commented Jul 1, 2017

You can ignore that one, you're all good 👍 Thanks. Cherry-picking this for 0.48.

@balloob balloob merged commit c13fdd2 into home-assistant:dev Jul 1, 2017
balloob pushed a commit that referenced this pull request Jul 1, 2017
1. The has_attributes was comparing names to addresses
2. Some errors outside of an except block were using
_LOGGER.except. This will cause an exception itself because there is no
trance context available to the logger
3. Added alias names for the address and state addresses so that they
can be accessed with the same
4. Added return values for the set_int_value and set_percentage methods
to allow error checking similar to the set_value method
5. Added the name of the configured object to the log messages to make
them more meaningful (otherwise multiple similar log messages are
received without any hint as to the target device)
@balloob balloob added this to the 0.48 milestone Jul 1, 2017
@balloob balloob mentioned this pull request Jul 1, 2017
@tiktok7 tiktok7 deleted the fix-base-knx-component branch July 2, 2017 08:31
@balloob balloob mentioned this pull request Jul 13, 2017
dethpickle pushed a commit to dethpickle/home-assistant that referenced this pull request Aug 18, 2017
1. The has_attributes was comparing names to addresses
2. Some errors outside of an except block were using
_LOGGER.except. This will cause an exception itself because there is no
trance context available to the logger
3. Added alias names for the address and state addresses so that they
can be accessed with the same
4. Added return values for the set_int_value and set_percentage methods
to allow error checking similar to the set_value method
5. Added the name of the configured object to the log messages to make
them more meaningful (otherwise multiple similar log messages are
received without any hint as to the target device)
@home-assistant home-assistant locked and limited conversation to collaborators Oct 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants