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 support for Vanderbilt SPC alarm panels and attached sensors #7663

Merged
merged 6 commits into from Jun 5, 2017

Conversation

Projects
None yet
6 participants
@mbrrg
Copy link
Contributor

commented May 19, 2017

Description:

Adds support Vanderbilt (formerly Siemens) SPC alarm systems and attached motion/smoke/door sensors. Communication is done through a third-party API gateway service called SPC Web Gateway that has to be installed locally. Sensors are automatically discovered and added on startup by asking the API gateway. All state changes are thereafter received asynchronously over a websocket provided by the API gateway.

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#2666

Example entry for configuration.yaml (if applicable):

# Example configuration.yaml entry
spc:
  api_url: API_URL
  ws_url: WS_URL

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][ex-requir]).
  • New dependencies are only imported inside functions that use them ([example][ex-import]).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.
  • Tests added
Add support for Vanderbilt SPC alarm panels.
 * Arm/disarm + read state

 * Autodiscover and add motion sensors
@mention-bot

This comment has been minimized.

Copy link

commented May 19, 2017

@mbrrg, thanks for your PR! By analyzing the history of the files in this pull request, we identified @fabaff, @balloob and @rmkraus to be potential reviewers.

def aioclient_mock():
areas = """{"status":"success","data":{"area":[{"id":"1","name":"House","mode":"0","last_set_time":"1485759851","last_set_user_id":"1","last_set_user_name":"Pelle","last_unset_time":"1485800564","last_unset_user_id":"1","last_unset_user_name":"Pelle","last_alarm":"1478174896"},{"id":"3","name":"Garage","mode":"0","last_set_time":"1483705803","last_set_user_id":"9998","last_set_user_name":"Lisa","last_unset_time":"1483705808","last_unset_user_id":"9998","last_unset_user_name":"Lisa"}]}}"""

zones = """{"status":"success","data":{"zone":[{"id":"1","type":"3","zone_name":"Kitchen smoke","area":"1","area_name":"House","input":"0","logic_input":"0","status":"0","proc_state":"0","inhibit_allowed":"1","isolate_allowed":"1"},{"id":"3","type":"0","zone_name":"Hallway PIR","area":"1","area_name":"House","input":"0","logic_input":"0","status":"0","proc_state":"0","inhibit_allowed":"1","isolate_allowed":"1"},{"id":"5","type":"1","zone_name":"Front door","area":"1","area_name":"House","input":"1","logic_input":"0","status":"0","proc_state":"0","inhibit_allowed":"1","isolate_allowed":"1"}]}}"""

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot May 19, 2017

line too long (606 > 79 characters)


@pytest.fixture
def aioclient_mock():
areas = """{"status":"success","data":{"area":[{"id":"1","name":"House","mode":"0","last_set_time":"1485759851","last_set_user_id":"1","last_set_user_name":"Pelle","last_unset_time":"1485800564","last_unset_user_id":"1","last_unset_user_name":"Pelle","last_alarm":"1478174896"},{"id":"3","name":"Garage","mode":"0","last_set_time":"1483705803","last_set_user_id":"9998","last_set_user_name":"Lisa","last_unset_time":"1483705808","last_unset_user_id":"9998","last_unset_user_name":"Lisa"}]}}"""

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot May 19, 2017

line too long (497 > 79 characters)

@pytest.fixture
def spcwebgw(hass):
yield spc.SpcWebGateway(hass=hass,
api_url='http://localhost/',

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot May 19, 2017

trailing whitespace


@pytest.fixture
def spcwebgw(hass):
yield spc.SpcWebGateway(hass=hass,

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot May 19, 2017

trailing whitespace

_LOGGER.warning("Unsuccessful websocket message "
"delivered, ignoring: %s", message)
try:
yield from async_callback(message['data']['sia'], *args)

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot May 19, 2017

indentation is not a multiple of four

mbrrg added some commits May 19, 2017

@balloob

balloob approved these changes Jun 5, 2017

Copy link
Member

left a comment

Nice! Thanks 🐬 🍺

@balloob balloob merged commit b90964f into home-assistant:dev Jun 5, 2017

3 of 4 checks passed

coverage/coveralls Coverage decreased (-0.2%) to 93.439%
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
hound No violations found. Woof!

@balloob balloob referenced this pull request Jun 16, 2017

Merged

0.47 #8055

@home-assistant home-assistant locked and limited conversation to collaborators Sep 4, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.