Skip to content
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

Fix inverted sensors on the concord232 binary sensor component #11261

Merged
merged 2 commits into from Dec 21, 2017

Conversation

CTLS
Copy link
Contributor

@CTLS CTLS commented Dec 21, 2017

Description:

This fixes the inverted sensors of the concord232 binary sensor component

Related issue (if applicable): fixes #10797

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.

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! See comment below.

@@ -118,7 +118,7 @@ def name(self):
def is_on(self):
"""Return true if the binary sensor is on."""
# True means "faulted" or "open" or "abnormal state"
return bool(self._zone['state'] == 'Normal')
return bool(self._zone['state'] == 'Tripped')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should check against 'Normal' according to the comment, since the zone can take multiple states that are not normal:
https://github.com/JasonCarter80/concord232/blob/5ec7987beb5fb6522322936fc52b4f0530b52eea/concord232/concord_commands.py#L129-L136

return bool(self._zone['state'] != 'Normal')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated it to reflect this change.

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MartinHjelmare MartinHjelmare merged commit b866687 into home-assistant:dev Dec 21, 2017
@MartinHjelmare MartinHjelmare added this to the 0.60.1 milestone Dec 21, 2017
pvizeli added a commit that referenced this pull request Dec 21, 2017
pvizeli added a commit that referenced this pull request Dec 21, 2017
* Revert "Adding MotionIP to BinarySensors for HMIP-SMI (#11268)"

This reverts commit c94cc34.

* Revert "Bugfix: 10509 - http is hard coded in plex sensor (#11072)"

This reverts commit 901d4b5.

* Revert "Fix handling zero values for state_on/state_off (#11264)"

This reverts commit 2e4e3a4.

* Revert "Fix inverted sensors on the concord232 binary sensor component (#11261)"

This reverts commit b866687.

* Revert "Proper Steam game names and small fixes (#11182)"

This reverts commit 7faa940.

* Revert "Bugfix homematic available modus (#11256)"

This reverts commit 1d57958.

* Revert "Fix detection of if a negative node is in use (#11255)"

This reverts commit b28bfad.

* Revert "added myself to become code owner for miflora and plant (#11251)"

This reverts commit e068204.

* Revert "Add workaround for running tox on Windows platforms (#11188)"

This reverts commit 81f1a65.

* Revert "Upgrade to new miflora version 0.2.0 (#11250)"

This reverts commit 8efc4b5.

* Revert "homematic: add username and password to interface config schema (#11214)"

This reverts commit b4e2537.

* Revert "Backup configuration files before overwriting (#11216)"

This reverts commit 90e25a6.
balloob pushed a commit that referenced this pull request Jan 5, 2018
* Fix inverted sensors on the concord232 binary sensor component

* Changed from == Tripped to != Normal
@balloob balloob mentioned this pull request Jan 5, 2018
@home-assistant home-assistant locked and limited conversation to collaborators May 29, 2018
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.

Concord232 binary sensors are all inverted
4 participants