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

Add Caddx/GE/Interlogix NetworX alarm panel support #1140

Merged
merged 2 commits into from
Feb 7, 2016

Conversation

kk7ds
Copy link
Contributor

@kk7ds kk7ds commented Feb 5, 2016

This adds support for NetworX-based alarm panels and should work for
any such panel equipped with a NX584 serial interface module. This
includes NX-4/6/8/8E, where the NX8E has this interface built-in.

It requires the pynx584 module, and requires running the server
component somewhere that has connectivity to the panel via serial,
which may include a serial-over-lan connection.

@balloobbot
Copy link

This is an automated response to help you succeed in getting this PR merged.

  • Whenever CI fails, the reason for failing will be at the bottom of the log. Each Python version performs different tests so it can be that only Python 3.5 fails. Your PR cannot be merged unless CI is green!
  • Always make sure your fork is up to date before you create a new branch. No "merge upstream" or "merge dev" commits. Also rebase on the dev branch before creating a PR.
  • Squash your commits when the PR is ready to be merged.

If your code communicates with devices:

  • Use a 3rd party library for communication. Add dependencies via REQUIREMENTS variable (example).
  • Only import your 3rd party dependencies inside functions that use it (example).
  • Run script/gen_requirements_all.py to update requirements_all.txt.
  • Add your new files to .coveragerc

If your code does not depend on external devices:

  • Write tests to verify your code works

def setup_platform(hass, config, add_devices, discovery_info=None):
""" Setup nx584. """
host = config.get('host', 'localhost:5007')

Copy link
Member

Choose a reason for hiding this comment

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

Can you verify the login is correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's no login, just connectivity. But I can test connectivity in init and log something, yeah.

This changes the service handler dispatch code to always
call update_ha_state(), and cleans up the alarm platforms that
were calling it themselves.
@kk7ds kk7ds force-pushed the add-nx584-alarm branch 2 times, most recently from 8e6c9cc to b0bdf1e Compare February 6, 2016 22:59
self._alarm = client.Client('http://%s' % host)
self._alarm.list_zones()
except requests.exceptions.ConnectionError as ex:
_LOGGER.error('Unable to connect to NX584: %s',
Copy link
Member

Choose a reason for hiding this comment

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

The alarm control panel component will keep polling this device because it has been added on line 38. You could consider catching the exception in setup_platform so that it will not get added to HA.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

This adds support for NetworX-based alarm panels and should work for
any such panel equipped with a NX584 serial interface module. This
includes NX-4/6/8/8E, where the NX8E has this interface built-in.

It requires the pynx584 module, and requires running the server
component somewhere that has connectivity to the panel via serial,
which may include a serial-over-lan connection.
balloob added a commit that referenced this pull request Feb 7, 2016
Add Caddx/GE/Interlogix NetworX alarm panel support
@balloob balloob merged commit 0ae36e1 into home-assistant:dev Feb 7, 2016
@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
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.

3 participants