python-sdk icon indicating copy to clipboard operation
python-sdk copied to clipboard

Question: Smart home control panel

Open ChopsKingsland opened this issue 4 years ago • 3 comments

I want to make a smart home control panel after I got my python program with the SinricPro library working. I want to do this with either a web server or PyGame. There is just 1 issue. Telling the Alexa service the current state of the device. When I push a button to turn on my lights using SinricPro, is there anyway to feed back to Alexa to show up on the app saying the current state? E.g. If I turned on my light from the control panel, I want the Alexa app to show that state change.

ChopsKingsland avatar Apr 03 '20 13:04 ChopsKingsland

@ChopsKingsland

There is an option for this also. You can use events that are in the example codes. You can try this simple example

thegoliathgeek avatar Apr 03 '20 17:04 thegoliathgeek

i've just tried using this, but I can't seem to integrate it into pygame. I put the python for pygame into the app.py, but it either runs pygame, and then when I close it, it runs SinricPro, or it runs none at all.

ChopsKingsland avatar Apr 03 '20 19:04 ChopsKingsland

It's because sinricpro lib uses asyncio. Which runs on the single-event loop. So running pygame and sinricpro on main thread is not a good idea. You need to run them on separate threads.

thegoliathgeek avatar Apr 04 '20 09:04 thegoliathgeek