Skip to content

Commit

Permalink
Added tox and updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
w1ll1am23 committed Jul 13, 2018
1 parent e4cbe7e commit ccbcbe7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,20 @@ from simplipy.api import SimpliSafeApiInterface

simplisafe = SimpliSafeApiInterface("USERNAME", "PASSWORD")


for system in simplisafe.get_systems():
print(system.state)
print(str(simplisafe.sensors))
print("Location ID: " + str(system.location_id))
print("System version: " + str(system.version))
print("System state: " + str(system.state))
print("Alarming: " + str(system.alarm_active))
print("Temperature: " + str(system.temperature))
print("Sensors:")
for sensor in system.get_sensors():
print(sensor.name)
print("\t" + str(sensor.status))
print("\t" + sensor.name())
print("\t\tType: " + str(sensor.type))
print("\t\tSerial: " + str(sensor.serial()))
print("\t\tData: " + str(sensor.data()))
print("\t\tStatus: " + str(sensor.status()))
print("\t\tBattery Ok: " + str(sensor.battery()))
print("\t\tOffline: " + str(sensor.offline()))
print("\t\tError: " + str(sensor.error()))
```
2 changes: 1 addition & 1 deletion src/simplipy/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def status(self):
def battery(self):
"""Return the battery status of the sensor."""
if self.version != 3:
return self.sensor_dict["battery"]
return self.sensor_dict.get("battery") == "ok"
return self._get_dict_values(["flags", "lowBattery"], False)

def data(self):
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 120

0 comments on commit ccbcbe7

Please sign in to comment.