Esempio n. 1
0
def get_info(request):
    # Get temp
    # logger.debug(apitimer.get_full_unit_now_time())
    temp_float = controldev.get_temp()
    status_list = controldev.get_all_device_status()
    # logger.debug(apitimer.get_full_unit_now_time())
    now_time = apitimer.get_real_time()
    # Return json
    return HttpResponse(json.dumps({'time': now_time, 'temp': temp_float, 'dev': status_list}),
                        content_type="application/json")
Esempio n. 2
0
def get_all_status(request):

    status_list = controldev.get_all_device_status()
    return HttpResponse(json.dumps(status_list), content_type='application/json')