Skip to content

Updated sensor.py to include ability to status entry sensors#8

Closed
qpe123 wants to merge 2 commits intobachya:devfrom
qpe123:dev
Closed

Updated sensor.py to include ability to status entry sensors#8
qpe123 wants to merge 2 commits intobachya:devfrom
qpe123:dev

Conversation

@qpe123
Copy link
Copy Markdown

@qpe123 qpe123 commented Sep 28, 2018

Updated sensor.py to include ability to status entry sensors

Added entryStatus for Open/Close sensors, returns open or closed for valid entry sensors for all other devices returns null
Copy link
Copy Markdown
Owner

@bachya bachya left a comment

Choose a reason for hiding this comment

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

A few comments. Additionally, before this can be merged, please make sure you complete these administrative steps:

  • Rebase your branch from the latest dev branch so that you're up to date.
  • Update README.md's examples to demonstrate that this new property exists for V2 systems.
  • Add a test that covers this new code.
  • Ensure that Travis passes; it's currently failing due to a linting issue.

Thanks!

Comment thread simplipy/sensor.py
return self.sensor_data['setting']

@property
def entrystatus(self) -> str:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Let's use entry_status as a property name.

Comment thread simplipy/sensor.py

@property
def entrystatus(self) -> str:
if self._type == SensorTypes.entry:
Copy link
Copy Markdown
Owner

@bachya bachya Sep 28, 2018

Choose a reason for hiding this comment

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

@bachya
Copy link
Copy Markdown
Owner

bachya commented Oct 3, 2018

While investigating further, I don't think this is the correct approach. The goal should be to provide an as-common-as-possible interface between V2 and V3 systems.

  • V2 entry sensors have an entryStatus property that can be open or closed.
  • V3 systems utilize the status.triggered property chain to communicate the same information (but with values of true or false).

Since this PR is well behind the dev base and is nearing a week of inactivity, I'm going to close it and apply these principles via a new PR. Thanks for your assistance!

@bachya bachya closed this Oct 3, 2018
@qpe123
Copy link
Copy Markdown
Author

qpe123 commented Oct 3, 2018 via email

@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants