You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.
def get_temp()
# Say a random response:
say @responses[rand(@responses.size)]+@master_name
Thread.new {
begin
output = `/home/pi/RaspberryScripts/loldht`
#output.scan(/Temp = (\d++.\d++) *C Hum = (\d++.\d++)/) do |temp, hum|
# say "Temperature #{temp} Degree Celsius and Humidity #{hum} %"
#Temp = 25.00 *C Hum = 41.00 %
#end
output = output.delete("^0-9.")
say "Live Temperature in your room is #{output[0,2]} Degree Celsius and Humidity #{output[5,2]} %"
rescue Exception => e
say "Sorry, Deepesh I encountered an error: #{e.inspect}"
ensure
request_completed
end
}
end
Intercepted via this regex ::
listen_for /(room temperature|temperature|live temperature|life temperature)/i do
get_temp()
end
Which results in this output at console ::
[Info - iPhone] Received Object: SpeechPacket
[Info - iPhone] Received Object: SpeechPacket
[Info - iPhone] Received Object: FinishSpeech
[Info - iPhone] Received Object: SetBackgroundContext
[Info - Guzzoni] Received Object: AssistantLoaded
[Info - Guzzoni] Received Object: SetConnectionHeader
[Info - Guzzoni] Received Object: GetAnchorsResponse
[Info - Guzzoni] Received Object: GetAnchorsResponse
[Info - Guzzoni] Received Object: RollbackSucceeded
[Info - Guzzoni] Received Object: CommandFailed
[Info - Guzzoni] Received Object: SpeechRecognized
[Info - Plugin Manager] Processing 'Temperature'
[Info - Plugin Manager] Processing plugin Example
[Info - Plugin Manager] Processing plugin Arduino
[Info - Plugin Manager] Matches (?i-mx:(room temperature|temperature|live temperature|life temperature))
[Info - Plugin Manager] Applicable states:
[Info - Plugin Manager] Current state:
[Info - Plugin Manager] Matches, executing block
[Info - Plugin Manager] Say: Just a moment., Deepesh
[Info - Plugin Manager] Say: Live Temperature in your room is 26 Degree Celsius and Humidity 45 %
[Info - Plugin Manager] Sending Request Completed
[Info - Plugin Manager] Plugins loaded: Example, Arduino
[Info - iPhone] Received Object: LoadAssistant
[Info - iPhone] Received Object: GetAnchors
[Info - iPhone] Received Object: GetAnchors
[Info - iPhone] Received Object: SetRestrictions
[Info - iPhone] Received Object: ClearContext
[Info - iPhone] Received Object: SetRestrictions
[Info - iPhone] Received Object: ClearContext
[Info - iPhone] Received Object: RollbackRequest
[Info - iPhone] Received Object: RollbackRequest
[Info - iPhone] Received Object: RollbackRequest
[Info - iPhone] Received Object: RollbackRequest
[Info - iPhone] Received Object: RollbackRequest
[Info - iPhone] Received Object: RollbackRequest
[Info - iPhone] Received Object: StartSpeechRequest
[Info - iPhone] Received Object: SetRequestOrigin
[Info - iPhone] Received Object: SpeechPacket
[Info - iPhone] Received Object: SpeechPacket
[Info - iPhone] Received Object: SpeechPacket
[Info - iPhone] Received Object: SpeechPacket
[Info - iPhone] Received Object: SpeechPacket
[Info - iPhone] Received Object: SpeechPacket
[Info - iPhone] Received Object: SpeechPacket
[Info - iPhone] Received Object: SpeechPacket
[Info - iPhone] Received Object: SpeechPacket
[Info - iPhone] Received Object: SpeechPacket
[Info - iPhone] Received Object: SpeechPacket
[Info - iPhone] Received Object: SpeechPacket
[Info - iPhone] Received Object: FinishSpeech
[Info - iPhone] Received Object: SetBackgroundContext
[Info - Guzzoni] Received Object: AssistantLoaded
[Info - Guzzoni] Received Object: SetConnectionHeader
[Info - Guzzoni] Received Object: GetAnchorsResponse
[Info - Guzzoni] Received Object: GetAnchorsResponse
[Info - Guzzoni] Received Object: CommandFailed
[Info - Guzzoni] Received Object: CommandFailed
[Info - Guzzoni] Received Object: RollbackSucceeded
[Info - Guzzoni] Received Object: CommandFailed
[Info - Guzzoni] Received Object: SpeechRecognized
[Info - Plugin Manager] Processing 'Temperature'
[Info - Plugin Manager] Processing plugin Example
[Info - Plugin Manager] Processing plugin Arduino
[Info - Plugin Manager] Matches (?i-mx:(room temperature|temperature|live temperature|life temperature))
[Info - Plugin Manager] Applicable states:
[Info - Plugin Manager] Current state:
[Info - Plugin Manager] Matches, executing block
[Info - Plugin Manager] Say: Please hold., Deepesh
[Info - Plugin Manager] Plugins loaded: Example, Arduino
[Info - Plugin Manager] Plugins loaded: Example, Arduino
[Info - Plugin Manager] Plugins loaded: Example, Arduino
[Info - iPhone] Received Object: LoadAssistant
[Info - iPhone] Received Object: ClearContext
[Info - Guzzoni] Received Object: AssistantLoaded
[Info - Guzzoni] Received Object: SetConnectionHeader
[Info - Guzzoni] Received Object: GetAnchorsResponse
[Info - Guzzoni] Received Object: GetAnchorsResponse
[Info - Guzzoni] Received Object: CommandFailed
[Info - Guzzoni] Received Object: CommandFailed
[Info - Guzzoni] Received Object: CommandFailed
[Info - Guzzoni] Received Object: CommandFailed
[Info - Guzzoni] Received Object: RollbackSucceeded
[Info - Guzzoni] Received Object: CommandFailed
[Info - Guzzoni] Received Object: SpeechRecognized
[Info - Plugin Manager] Processing 'Temperature'
[Info - Plugin Manager] Processing plugin Example
[Info - Plugin Manager] Processing plugin Arduino
[Info - Plugin Manager] Matches (?i-mx:(room temperature|temperature|live temperature|life temperature))
[Info - Plugin Manager] Applicable states:
[Info - Plugin Manager] Current state:
[Info - Plugin Manager] Matches, executing block
[Info - Plugin Manager] Say: Hang on a second., Deepesh
[Info - Plugin Manager] Plugins loaded: Example, Arduino
[Info - Plugin Manager] Plugins loaded: Example, Arduino
[Info - Plugin Manager] Say: Live Temperature in your room is 26 Degree Celsius and Humidity 45 %
[Info - Plugin Manager] Sending Request Completed
[Info - Plugin Manager] Say: Live Temperature in your room is .. Degree Celsius and Humidity .. %
[Info - Plugin Manager] Sending Request Completed
As you can see the command is getting executed multiple times but no response gets received on phone and all I see is the endless spin.
The text was updated successfully, but these errors were encountered:
If I had to guess, I would suspect the problem is with the begin-resuce-ensure-end. First try getting it to work without it, then try replacing ensure with end remove one of the other end statements.
Thanks, I will look into this. I was using a new thread to execute python code with other matches, and when not using a new thread Siri skipped the "Say" statements on my phone executing the command (the task get executed but no response is sent to phone).
I have read some posts about necessary tricks to return from python from within ruby. Post a question on stackoverflow if you don't find what you are looking for.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am using this plugin command ::
Intercepted via this regex ::
Which results in this output at console ::
As you can see the command is getting executed multiple times but no response gets received on phone and all I see is the endless spin.
The text was updated successfully, but these errors were encountered: