Coder Social home page Coder Social logo

add command about siri-api HOT 13 CLOSED

robinmeis avatar robinmeis commented on August 16, 2024
add command

from siri-api.

Comments (13)

RobinMeis avatar RobinMeis commented on August 16, 2024

Oh I know ... I wanted to have fixed that before the release. Let me guess: You used spaces to indent? In my development I used accidently tabs instead of spaces. I fixed it now.

from siri-api.

Doriginal avatar Doriginal commented on August 16, 2024

ok thank you.
After upgrade now i:

root@ubuntu:~/Siri-API-master# python3 server.py
Traceback (most recent call last):
File "server.py", line 7, in
from commands import commands
File "/root/Siri-API-master/commands.py", line 23
html = document(self.connection)
^
TabError: inconsistent use of tabs and spaces in indentation

from siri-api.

RobinMeis avatar RobinMeis commented on August 16, 2024

What do you have in line 23 in commands.py? Do you have still the light definition or did you replace it?

from siri-api.

Doriginal avatar Doriginal commented on August 16, 2024

i have:

def remote(self, q, wildcards):
html = document(self.connection)
html.redirect("http://192.168.0.5/freeremote/" ) #Only works in my setup
html.send()

from siri-api.

RobinMeis avatar RobinMeis commented on August 16, 2024

You have to indent the commands bellow the def to tell Python that this code is for the definition. It is the same with if and while statements. In most languages indention is just for readability but in Python it is required to parse the code. Your example has to look like this:

def remote(self, q, wildcards):
    html = document(self.connection)
    html.redirect("http://192.168.0.5/freeremote/" ) #Only works in my setup
    html.send()

from siri-api.

Doriginal avatar Doriginal commented on August 16, 2024

yes these github which to remove the spaces, the code looks like this

capture

from siri-api.

RobinMeis avatar RobinMeis commented on August 16, 2024

Did you use tabs or spaces for indention?

from siri-api.

Doriginal avatar Doriginal commented on August 16, 2024

i use spaces

from siri-api.

RobinMeis avatar RobinMeis commented on August 16, 2024

What happens if you use tabs? I guess you haven't updated to commands.py with my latest update?

from siri-api.

Doriginal avatar Doriginal commented on August 16, 2024

yes i have the latest.
I copied / pasted a piece of one of your light control and now it works

from siri-api.

Doriginal avatar Doriginal commented on August 16, 2024

I tried to get a word to send to an online dictionary.
if I said "dictionary" + word it displays the error "Sorry, I do not know how to Do That"
this the code:
capture

from siri-api.

RobinMeis avatar RobinMeis commented on August 16, 2024

So as I can see you tried to use wilcards. By default, you seperate just words with a comma. One of these words have to match to call the assigned function. If you want to use wildcards you can also define multiple sentences which can be useful if there are different dictions or if Siri understands often similar words.
So you have to tell the search function that you want to search with wildcards. Since you need multiple parts in a sentence it is stored in a dictionary. I will add this in the documentation in detail in the next days.
So you have to put brackets around your statement
..["dictionaire", "*"]..

from siri-api.

Doriginal avatar Doriginal commented on August 16, 2024

great thank's so much, now work fine now.
is the code i have put for dictionary.
Many thank's for your help

capture

from siri-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.