Skip to content

Commit

Permalink
Merge pull request #63 from chiefwigms/pico_pico_still_api
Browse files Browse the repository at this point in the history
initial api endpoints added supporting picostill integration with pico c/s/pro models
  • Loading branch information
tmack8001 authored Jul 20, 2020
2 parents fe7940d + b293ed4 commit 13217be
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions app/main/routes_pico_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,36 @@ def process_log(args):
return '\r\n\r\n'


# Pico with Picostill requests
pico_still_args = {
'picoUid': fields.Str(required=True), # 32 character alpha-numeric serial number
'picoStillUid': fields.Str(required=True), # 12 character alpha-numeric serial number
}

# Can Use Still: /API/pico/canUsePicoStill?picoUid={UID}&picoStillUid={UID}
# Response: '#{0}#\r\n' where {0} : T (or F?)
@main.route('/API/pico/canUsePicoStill')
@use_args(pico_still_args, location='querystring')
def process_can_use_pico_still(args):
return '#T#\r\n'

# Has cleaned still: /API/pico/hasCleanedAck?picoUid={UID}&picoStillUid={UID}
# Response: '#{0}#\r\n' where {0} : T (or F?)
@main.route('/API/pico/hasCleanedAck')
@use_args(pico_still_args, location='querystring')
def process_is_cleaned(args):
return '#T#\r\n'

# Set cleaned still: /API/pico/setCleanedAck?picoUid={UID}&picoStillUid={UID}
# Response: '#T#\r\n'
# Allows a user override of hasCleanedAck if unsuccessful
@main.route('/API/pico/setCleanedAck')
@use_args(pico_still_args, location='querystring')
def process_set_cleaned(args):
return '#T#\r\n'



# -------- Utility --------
def get_recipe_by_id(recipe_id):
recipe = next((r for r in get_pico_recipes() if r.id == recipe_id), None)
Expand Down

0 comments on commit 13217be

Please sign in to comment.