def start_broadcast(broadcast_id, remote_id): redis_session.sadd('remote_ids', remote_id) _rset('remote_to_broadcast_id_%s' % (broadcast_id, ), remote_id) _rset('broadcast_to_remote_id_%s' % (remote_id, ), broadcast_id) _rset('broadcast_info_%s' % broadcast_id, {"init_time": time.time(), "screens": {}}) return broadcast_id
def register_device(device_id, device_name, screen_id, pairing_info): redis_session.sadd('device_ids', device_id) _rset('device_to_screen_id_%s' % device_id, screen_id) _rset('device_to_device_name_%s' % device_id, device_name) _rset('device_to_pairing_info_%s' % device_id, pairing_info) _rset('screen_to_device_id_%s' % screen_id, device_id) _rset('screen_info_%s' % screen_id, {"init_time": time.time(), "broadcasts": {}}) return screen_id