Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
Updated devices view in preparation of editing
Browse files Browse the repository at this point in the history
Also removed some unused flat ui
  • Loading branch information
p3tecracknell committed Apr 5, 2014
1 parent 69678de commit 38e0c40
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 496 deletions.
2 changes: 1 addition & 1 deletion tellprox/bottle_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_int(key):
try:
return int(num)
except ValueError:
return num
return 0

def get_string(key):
return request.query.get(key) or request.forms.get(key)
Expand Down
11 changes: 3 additions & 8 deletions tellprox/schedulerApi.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, api, config, scheduler):
'setjob': {
'fn': self.setjob,
'inputs': [
{ 'name': 'id', 'type': 'string', 'description': 'The job id, when updating an existing job' },
{ 'name': 'id', 'type': 'int', 'description': 'The job id, when updating an existing job' },
{ 'name': 'deviceId', 'type': 'string', 'description': 'The device id to schedule. Only valid when creating a new job' },
{ 'name': 'method', 'type': 'string', 'description': 'What to do when the schedule runs. This should be any of the method constants' },
{ 'name': 'methodValue', 'type': 'int', 'description': 'Only required for methods that requires this.' },
Expand Down Expand Up @@ -103,20 +103,15 @@ def restartSchedulerThread(self):

def setjob(self, func, id, deviceId, method, methodValue, type, hour,
minute, offset, randomInterval, retries, retryInterval, reps, active, weekdays):

if id:
try:
id = int(id)
except ValueError:
id = None

# If no ID is provided, find the next available
if id is None == 0 or id == 0:
if id is None or id == 0:
keys = self.jobs.keys()
if len(keys) == 0:
id = 1
else:
id = max([int(k) for k in keys]) + 1

id = str(id)

newJob = {
Expand Down
2 changes: 1 addition & 1 deletion tellprox/static/css/bootstrap.min.css

Large diffs are not rendered by default.

Loading

0 comments on commit 38e0c40

Please sign in to comment.