Skip to content

Commit

Permalink
Clean up total_connect_user code and various formatting fixes. Bump to
Browse files Browse the repository at this point in the history
0.55
  • Loading branch information
austinmroczek committed Apr 5, 2020
1 parent e750762 commit 34c1e8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name = 'total_connect_client',
py_modules = ['total_connect_client'],
version = '0.54.1',
version = '0.55',
description = 'Interact with Total Connect 2 alarm systems',
author = 'Craig J. Midwinter',
author_email = 'craig.j.midwinter@gmail.com',
Expand All @@ -12,7 +12,6 @@
keywords = ['alarm','TotalConnect'],
package_data = {'': ['data/*.json']},
install_requires = ['zeep'],
# packages=find_packages(exclude=['tests', 'tests.*']),
packages=['total_connect_client'],
include_package_data=True, # use MANIFEST.in during install
zip_safe=False
Expand Down
15 changes: 3 additions & 12 deletions total_connect_client/TotalConnectClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def __init__(self, username, password, usercode="-1", auto_bypass_battery=False)
)
self._module_flags = None
self._user = None
self._user_info = None
self.locations = {}
self.authenticate()

Expand Down Expand Up @@ -178,7 +177,6 @@ def populate_details(self, response):
location_data = response["Locations"]["LocationInfoBasic"]

self._module_flags = response["ModuleFlags"]
self._user_info = response["UserInfo"]

self._user = total_connect_user(response["UserInfo"])

Expand Down Expand Up @@ -479,9 +477,7 @@ def __str__(self):
)

def set_zone_details(self, zone_status):
"""Set status based on GetZonesListInStateEx_V1.
Return true if successful.
"""
"""Update from GetZonesListInStateEx_V1. Return true if successful."""
zones = zone_status.get("Zones")
if zones is None:
return False
Expand All @@ -499,9 +495,7 @@ def set_zone_details(self, zone_status):
return True

def set_status(self, data):
"""Update status based on a 'PanelMetadataAndStatus'.
Return true if successful.
"""
"""Update from 'PanelMetadataAndStatus'. Return true on success."""
self.ac_loss = data.get("IsInACLoss")
self.low_battery = data.get("IsInLowBattery")
self.cover_tampered = data.get("IsCoverTampered")
Expand Down Expand Up @@ -700,10 +694,7 @@ class total_connect_user:
"""User for Total Connect."""

def __init__(self, user_info):
"""Initialize based on UserInfo.
Returned from LoginAndGetSessionDetails.
"""

"""Initialize based on UserInfo from LoginAndGetSessionDetails."""
self._user_id = user_info["UserID"]
self._username = user_info["Username"]

Expand Down

0 comments on commit 34c1e8e

Please sign in to comment.