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

Fixed status reporting and expose new modes (arm night, arm max) #16051

Closed
wants to merge 4 commits into from

Conversation

abarbaccia
Copy link

@abarbaccia abarbaccia commented Aug 18, 2018

Description:

I reworked the status reporting on envisalink boards. This should now correctly report for ARMING and differentiate between ARM HOME and ARM NIGHT.

I also started to add support for ARM MAX which is when you arm away and have no exit delay (some systems call this "vacation mode"). The capability already seems to be present in pyenvisalink but not sure if it's exposed in the home assistant components yet. For now, it's only status, so it's reported correctly if you arm that mode from the envisalink app.

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:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

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.

Cinntax and others added 2 commits August 12, 2018 23:43
Add support for Arm Max (arm away + no entry delay)
@homeassistant
Copy link
Contributor

Hi @abarbaccia,

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!

state = STATE_ALARM_ARMED_MAX
elif self._info['status']['armed_stay'] and not self._info['status']['armed_zero_entry_delay']:
state = STATE_ALARM_ARMED_HOME
elif self._info['status']['armed_stay'] and self._info['status']['armed_zero_entry_delay']:

Choose a reason for hiding this comment

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

line too long (99 > 79 characters)

state = STATE_ALARM_ARMED_AWAY
elif self._info['status']['armed_away'] and self._info['status']['armed_zero_entry_delay']:
state = STATE_ALARM_ARMED_MAX
elif self._info['status']['armed_stay'] and not self._info['status']['armed_zero_entry_delay']:

Choose a reason for hiding this comment

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

line too long (103 > 79 characters)

elif self._info['status']['alpha']:
elif self._info['status']['armed_away'] and not self._info['status']['armed_zero_entry_delay']:
state = STATE_ALARM_ARMED_AWAY
elif self._info['status']['armed_away'] and self._info['status']['armed_zero_entry_delay']:

Choose a reason for hiding this comment

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

line too long (99 > 79 characters)

elif self._info['status']['entry_delay']:
state = STATE_ALARM_PENDING
elif self._info['status']['alpha']:
elif self._info['status']['armed_away'] and not self._info['status']['armed_zero_entry_delay']:

Choose a reason for hiding this comment

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

line too long (103 > 79 characters)

STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
STATE_UNKNOWN, STATE_ALARM_TRIGGERED, STATE_ALARM_PENDING, ATTR_ENTITY_ID)
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT, STATE_ALARM_ARMED_MAX, STATE_ALARM_DISARMED,
STATE_UNKNOWN, STATE_ALARM_ARMING, STATE_ALARM_TRIGGERED, STATE_ALARM_PENDING, ATTR_ENTITY_ID)

Choose a reason for hiding this comment

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

line too long (98 > 79 characters)

@@ -17,8 +17,8 @@
DATA_EVL, EnvisalinkDevice, PARTITION_SCHEMA, CONF_CODE, CONF_PANIC,
CONF_PARTITIONNAME, SIGNAL_KEYPAD_UPDATE, SIGNAL_PARTITION_UPDATE)
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
STATE_UNKNOWN, STATE_ALARM_TRIGGERED, STATE_ALARM_PENDING, ATTR_ENTITY_ID)
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT, STATE_ALARM_ARMED_MAX, STATE_ALARM_DISARMED,

Choose a reason for hiding this comment

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

line too long (121 > 79 characters)

Copy link
Author

@abarbaccia abarbaccia left a comment

Choose a reason for hiding this comment

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

I tested these on my envisalink hardware and it works as expected.

@bachya
Copy link
Contributor

bachya commented Aug 21, 2018

@abarbaccia You still need to fix your linting issues (both those provided by Hound and those provided by Travis).

Add functionality to call Arm Max service
state = STATE_ALARM_ARMED_HOME
elif self._info['status']['armed_stay'] and
self._info['status']['armed_zero_entry_delay']:
state = STATE_ALARM_ARMED_NIGHT

Choose a reason for hiding this comment

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

expected an indented block

not self._info['status']['armed_zero_entry_delay']:
state = STATE_ALARM_ARMED_HOME
elif self._info['status']['armed_stay'] and
self._info['status']['armed_zero_entry_delay']:

Choose a reason for hiding this comment

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

unexpected indentation

elif self._info['status']['armed_stay'] and
not self._info['status']['armed_zero_entry_delay']:
state = STATE_ALARM_ARMED_HOME
elif self._info['status']['armed_stay'] and

Choose a reason for hiding this comment

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

trailing whitespace

state = STATE_ALARM_ARMED_MAX
elif self._info['status']['armed_stay'] and
not self._info['status']['armed_zero_entry_delay']:
state = STATE_ALARM_ARMED_HOME

Choose a reason for hiding this comment

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

expected an indented block

self._info['status']['armed_zero_entry_delay']:
state = STATE_ALARM_ARMED_MAX
elif self._info['status']['armed_stay'] and
not self._info['status']['armed_zero_entry_delay']:

Choose a reason for hiding this comment

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

unexpected indentation

elif self._info['status']['entry_delay']:
state = STATE_ALARM_PENDING
elif self._info['status']['alpha']:
elif self._info['status']['armed_away'] and

Choose a reason for hiding this comment

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

trailing whitespace
SyntaxError: invalid syntax

STATE_UNKNOWN, STATE_ALARM_TRIGGERED, STATE_ALARM_PENDING, ATTR_ENTITY_ID)
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_ARMED_MAX, STATE_ALARM_DISARMED, STATE_UNKNOWN,
STATE_ALARM_ARMING, STATE_ALARM_TRIGGERED, STATE_ALARM_PENDING,

Choose a reason for hiding this comment

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

trailing whitespace

STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
STATE_UNKNOWN, STATE_ALARM_TRIGGERED, STATE_ALARM_PENDING, ATTR_ENTITY_ID)
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_ARMED_MAX, STATE_ALARM_DISARMED, STATE_UNKNOWN,

Choose a reason for hiding this comment

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

trailing whitespace

@@ -17,8 +17,10 @@
DATA_EVL, EnvisalinkDevice, PARTITION_SCHEMA, CONF_CODE, CONF_PANIC,
CONF_PARTITIONNAME, SIGNAL_KEYPAD_UPDATE, SIGNAL_PARTITION_UPDATE)
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
STATE_UNKNOWN, STATE_ALARM_TRIGGERED, STATE_ALARM_PENDING, ATTR_ENTITY_ID)
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT,

Choose a reason for hiding this comment

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

trailing whitespace

@@ -13,7 +13,8 @@
from homeassistant.const import (
ATTR_CODE, ATTR_CODE_FORMAT, ATTR_ENTITY_ID, SERVICE_ALARM_TRIGGER,
SERVICE_ALARM_DISARM, SERVICE_ALARM_ARM_HOME, SERVICE_ALARM_ARM_AWAY,
SERVICE_ALARM_ARM_NIGHT, SERVICE_ALARM_ARM_CUSTOM_BYPASS)
SERVICE_ALARM_ARM_NIGHT, SERVICE_ALARM_ARM_MAX,

Choose a reason for hiding this comment

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

trailing whitespace

@abarbaccia abarbaccia changed the title Fixed status Fixed status reporting and expose new arm services (arm night, arm max) Aug 21, 2018
@abarbaccia abarbaccia changed the title Fixed status reporting and expose new arm services (arm night, arm max) Fixed status reporting and expose new modes (arm night, arm max) Aug 21, 2018
@balloob
Copy link
Member

balloob commented Nov 6, 2018

This PR seems to have gone stale. Closing it.

@balloob balloob closed this Nov 6, 2018
@ghost ghost removed the in progress label Nov 6, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Feb 5, 2019
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.

None yet

7 participants