Skip to content

Commit

Permalink
Merge pull request #79 from austinmroczek/master
Browse files Browse the repository at this point in the history
Multiple updates
  • Loading branch information
austinmroczek committed May 9, 2020
2 parents 718c0d9 + 01fba6d commit 1e19df3
Show file tree
Hide file tree
Showing 10 changed files with 187 additions and 170 deletions.
30 changes: 29 additions & 1 deletion README.md
@@ -1,4 +1,32 @@
# Total-Connect-Client
Total-Connect-Client is a super simple python client for interacting with TotalConnect2 alarm system.

Currently this library only supports arming (away, stay, and night), disarming and getting panel status. I wrote this mostly to add alarm support for my personal HomeAssistant set-up, but if there is demand for more functionality I can look into adding it.
Started by @craigjmidwinter to add alarm support for his personal HomeAssistant set-up, with later contributions from others.

The code currently supports:
- Arming (away, stay, night)
- Disarming
- Getting panel status (armed, bypassed, etc)
- Getting zone status (normal, fault, trouble, low battery, etc)

## Troubleshooting

If you're having trouble with your system, or find an error message, we may ask you to submit information about your alarm system. To do that from the command line do the following steps (assuming you are running from within Home Assistant):

First download the latest files:
- `wget https://raw.githubusercontent.com/craigjmidwinter/total-connect-client/master/total_connect_client/TotalConnectClient.py`
- `wget https://raw.githubusercontent.com/craigjmidwinter/total-connect-client/master/total_connect_client/info.py`

The run the script:
- A usercode is not required for most systems. Enter '-1' in it's place unless you need to enter your panel code.
- `python3 info.py username password usercode`

If you want to easily put the info into a file for sharing:
- `python3 info.py username password usercode > my_info.txt`
- Now the file my_info.txt in the same directory will hold all of that information

**WARNING**: the script will include private information including your username and password. Carefully remove it before sharing with the developers or posting on Github.

Create an Issue on Github and post both your problem and your system information.

Why do we ask for this information? The TotalConnect API documentation provides little information on the status codes and other information it returns about your system. We developed as best we could using the codes our own systems returned. We have seen many times that other users with issues have different system status codes.
3 changes: 2 additions & 1 deletion RESULT_CODES.md
Expand Up @@ -19,6 +19,7 @@ ResultCode | ResultData | Notes
-4504 | Failed to Bypass Zone | Happens when requesting to bypass a non-existent zone.
-9001 | Authorization Failed to Perform Notification Configuration | Received when trying getAllSensorsMaskStatus
-10026 | Unable to load your scenes, please try syncing your panel in the Locations menu. If your panel is still not connecting, please contact your Security Dealer for support |
-12104 | Automation - We are unable to load your automation devices, please try again or contact your security dealer for support | GetAutomationDeviceStatus with location module flag Automation = 0
-50004 | Input validation failed - Parameter - {0} | Bad username and password provided

Zone Bypass returns SUCCESS even if the zone was in bypass state prior to the request.
Zone Bypass returns SUCCESS even if the zone was in bypass state prior to the request.
29 changes: 15 additions & 14 deletions setup.py
@@ -1,18 +1,19 @@
from distutils.core import setup
from setuptools import setup, find_packages

setup(
name = 'total_connect_client',
py_modules = ['total_connect_client'],
version = '0.55',
description = 'Interact with Total Connect 2 alarm systems',
author = 'Craig J. Midwinter',
author_email = 'craig.j.midwinter@gmail.com',
url = 'https://github.com/craigjmidwinter/total-connect-client',
download_url = 'https://github.com/craigjmidwinter/total-connect-client',
keywords = ['alarm','TotalConnect'],
package_data = {'': ['data/*.json']},
install_requires = ['zeep'],
packages=['total_connect_client'],
include_package_data=True, # use MANIFEST.in during install
zip_safe=False
name="total_connect_client",
py_modules=["total_connect_client"],
version="0.55",
description="Interact with Total Connect 2 alarm systems",
author="Craig J. Midwinter",
author_email="craig.j.midwinter@gmail.com",
url="https://github.com/craigjmidwinter/total-connect-client",
download_url="https://github.com/craigjmidwinter/total-connect-client",
keywords=["alarm", "TotalConnect"],
package_data={"": ["data/*.json"]},
install_requires=["zeep"],
packages=["total_connect_client"],
include_package_data=True, # use MANIFEST.in during install
zip_safe=False,
)
2 changes: 1 addition & 1 deletion tests/const.py
Expand Up @@ -8,6 +8,6 @@
"LocationName": "Home",
"SecurityDeviceID": "987654",
"PhotoURL": "http://www.example.com/some/path/to/file.jpg",
"LocationModuleFlags": None,
"LocationModuleFlags": "Security=1,Video=0,Automation=0,GPS=0,VideoPIR=0",
"DeviceList": None,
}
5 changes: 1 addition & 4 deletions tests/test_client_arm_disarm.py
Expand Up @@ -26,10 +26,7 @@ def setUp(self):
self.client.locations[self.location_id] = Mock()
self.client.locations[self.location_id].security_device_id = "987654"

self.response = {
"ResultCode": -1,
"ResultData": "test",
}
self.response = {"ResultCode": -1, "ResultData": "test"}

def tearDown(self):
"""Test cleanup."""
Expand Down
16 changes: 3 additions & 13 deletions tests/test_get_zone_details.py
Expand Up @@ -26,21 +26,11 @@

ZONE_STATUS = {"Zones": ZONES}

RESULT_SUCCESS = {
"ResultCode": 0,
"ResultData": "Success",
"ZoneStatus": ZONE_STATUS,
}
RESULT_SUCCESS = {"ResultCode": 0, "ResultData": "Success", "ZoneStatus": ZONE_STATUS}

RESULT_NOT_SUPPORTED = {
"ResultCode": -120,
"ResultData": "Not Supported",
}
RESULT_NOT_SUPPORTED = {"ResultCode": -120, "ResultData": "Not Supported"}

RESULT_UNKNOWN = {
"ResultCode": 999,
"ResultData": "Unknown",
}
RESULT_UNKNOWN = {"ResultCode": 999, "ResultData": "Unknown"}


class FakeGoodClient(TotalConnectClient.TotalConnectClient):
Expand Down

0 comments on commit 1e19df3

Please sign in to comment.