Skip to content

lazyxcientist/xparo_api

Repository files navigation

    ██╗░░██╗██████╗░░█████╗░██████╗░░█████╗░
    ╚██╗██╔╝██╔══██╗██╔══██╗██╔══██╗██╔══██╗
    ░╚███╔╝░██████╔╝███████║██████╔╝██║░░██║
    ░██╔██╗░██╔═══╝░██╔══██║██╔══██╗██║░░██║
    ██╔╝╚██╗██║░░░░░██║░░██║██║░░██║╚█████╔╝
    ╚═╝░░╚═╝╚═╝░░░░░╚═╝░░╚═╝╚═╝░░╚═╝░╚════╝░


        █▀▀█ █▀▀ █▀▄▀█ █▀▀█ ▀▀█▀▀ █▀▀ 
        █▄▄▀ █▀▀ █░▀░█ █░░█ ░░█░░ █▀▀ 
        ▀░▀▀ ▀▀▀ ▀░░░▀ ▀▀▀▀ ░░▀░░ ▀▀▀

website: https://xparo-website.onrender.com/

github: https://github.com/lazyxcientist/xparo_remote

email: [email protected]

requriements = websocket_client



how to use X.P.A.R.O


step 1 : go to https://xparo-website.onrender.com/dashboard and create an new project by clicking on "add new" button.

step 2 : now go to your project

step 3 : copy the project_id (or secret_key if any) of your project.

step 4 : copy API code given below and paste your keys there.

step 5: for adding remote you need to hover to menu present at top corner then go to control

step 6 : choose any custom remote or create a new remote


how to use API


baisc setup

from xparo import Project

xp = Project("email","project_id","secret_key_if_any")

REMOTE controller

everytime you use remote , this function will call

from xparo import Project

xp = Project("email","project_id","secret_key_if_any")


## this fuction is called when new data is recieved from remote

def remote_callback(command,remote_id): 
    print(message)
xp.remote_callback = remote_callback

# to send custom remote command or use as it remote

# type 1: send remote command 
xp.send("command") 

# type2 send remote command with unique remote id
xp.send("command","remote_id")

send custom ERROR

from xparo import Project

xp = Project("email","project_id","secret_key_if_any")

# send command 
xp.send_error("error") 

# type2 send command with type of error
xp.send_error("error","error type")

## basic ERRORS are send automaticaly

get , update or add config

this config give flexibility to change while project is deployed in realworld.

you can change this at your dashboard/control/change config

from xparo import Project
import os

xp = Project("email","project_id","secret_key_if_any")

# set config json file path
xp.config_path = os.path.join(os.path.dirname(__file__), 'config.json')

# this return dict of config
print(xp.config)

# update or add the configuration globaly
xp.update_config("key","value")

# add callback to config change
def config_changed(key,val):
    print(key,val)
xp.config_callback = config_changed

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published