Skip to content

Commit c31e7ce

Browse files
authored
Merge pull request #34 from sinricpro/2.5.1
clean up
2 parents 2e805a3 + 6590c04 commit c31e7ce

File tree

3 files changed

+10
-151
lines changed

3 files changed

+10
-151
lines changed

README.md

Lines changed: 1 addition & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
## Dependencies
1010
* Python 3.9.7 or newer
1111
* websockets 8.1
12-
13-
### Check the examples [here](https://github.com/sinricpro/Python-Examples)
14-
15-
### How to set it up? click [here](https://dev.to/imdhanush/automation-with-alexa-jo)
16-
1712
### Install
1813

1914
pip install sinricpro --user
@@ -22,100 +17,4 @@
2217

2318
pip install sinricpro --upgrade --user
2419

25-
### Simple example
26-
27-
```python
28-
from sinric import SinricPro
29-
from sinric import SinricProUdp
30-
import asyncio
31-
32-
appKey = '' # d89f1***-****-****-****-************
33-
secretKey = '' # f44d1d31-1c19-****-****-9bc96c34b5bb-d19f42dd-****-****-****-************
34-
device1 = '' # 5d7e7d96069e275ea9******
35-
device2 = '' # 5d80ac5713fa175e99******
36-
deviceIdArr = [device1,device2]
37-
38-
def Events():
39-
while True:
40-
# Select as per your requirements
41-
# REMOVE THE COMMENTS TO USE
42-
# client.event_handler.raiseEvent(device1, 'setPowerState',data={'state': 'On'})
43-
pass
44-
def onPowerState(did, state):
45-
# Alexa, turn ON/OFF Device
46-
print(did, state)
47-
return True, state
48-
49-
50-
eventsCallbacks={
51-
"Events": Events
52-
}
53-
54-
callbacks = {
55-
'powerState': onPowerState
56-
}
57-
58-
if __name__ == '__main__':
59-
loop = asyncio.get_event_loop()
60-
61-
client = SinricPro(appKey, deviceIdArr, callbacks,event_callbacks=eventsCallbacks,
62-
enable_log=False,restore_states=True,secretKey=secretKey)
63-
64-
udp_client = SinricProUdp(callbacks,deviceIdArr,
65-
enable_trace=False, loopInstance=loop) # Set enable_trace to True to start logging request Offline Request/Response
66-
67-
loop.run_until_complete(client.connect(udp_client=udp_client))
68-
69-
```
70-
71-
### Credentials file (credential.py)
72-
73-
```python
74-
appKey = 'd89f1***-****-****-****-************'
75-
secretKey = 'f44d1d31-1c19-****-****-9bc96c34b5bb-d19f42dd-****-****-****-************'
76-
deviceId1 = '5d7e7d96069e275ea9******'
77-
deviceId2 = ' 5j7e7d96069e275ea9******'
78-
deviceId3 = ' 5d7e7d96069e275ea9******'
79-
lock = ' 5d7e7d96069e275ea9******'
80-
deviceIdArr = [deviceId1, deviceId2, deviceId3, lock]
81-
```
82-
83-
### Pro Switch [Demo](https://github.com/sinricpro/Python-Examples/tree/master/pro_switch_example):
84-
85-
```python
86-
from sinric import SinricPro
87-
from sinric import SinricProUdp
88-
from credentials import appKey, deviceIdArr, secretKey
89-
from time import sleep
90-
91-
def Events():
92-
while True:
93-
# Select as per your requirements
94-
# REMOVE THE COMMENTS TO USE
95-
# client.event_handler.raiseEvent(device1, 'setPowerState',data={'state': 'On'})
96-
pass
97-
def onPowerState(did, state):
98-
# Alexa, turn ON/OFF Device
99-
print(did, state)
100-
return True, state
101-
102-
103-
eventsCallbacks={
104-
"Events": Events
105-
}
106-
107-
callbacks = {
108-
'powerState': onPowerState
109-
}
110-
111-
if __name__ == '__main__':
112-
loop = asyncio.get_event_loop()
113-
114-
client = SinricPro(appKey, deviceIdArr, callbacks,event_callbacks=eventsCallbacks,
115-
enable_log=False,restore_states=True,secretKey=secretKey)
116-
117-
udp_client = SinricProUdp(callbacks,deviceIdArr,
118-
enable_trace=False, loopInstance=loop) # Set enable_trace to True to start logging request Offline Request/Response
119-
120-
loop.run_until_complete(client.connect(udp_client=udp_client))
121-
```
20+
### Check the examples [here](https://github.com/sinricpro/Python-Examples)

README.rst

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
SINRIC PRO
22
===============
33

4-
This is a python library for alexa home automation skill
5-
SINRIC PRO https://sinric.pro/
6-
7-
8-
Python-2.7 Not Supported
9-
========================
10-
11-
12-
Functions:
13-
----------
14-
* Automate your home using alexa with sinricpro
4+
Automate your home using Amazon Alexa, Google Home, SmartThings with Sinric Pro https://sinric.pro/
155

166
Installation :
177
--------------
@@ -23,39 +13,7 @@ Python3
2313

2414
python3 -m pip install sinricpro --user
2515

16+
Examples :
17+
--------------
2618

27-
Pro Switch Demo:
28-
~~~~~~~~~~~~~~~~~
29-
30-
::
31-
32-
from sinric import SinricPro
33-
from sinric import SinricProUdp
34-
from credentials import appKey, deviceId, secretKey
35-
from time import sleep
36-
37-
def Events():
38-
while True:
39-
# Select as per your requirements
40-
# REMOVE THE COMMENTS TO USE
41-
# client.event_handler.raiseEvent(deviceId1, 'setPowerState',data={'state': 'On'})
42-
sleep(2) #Sleep for 2 seconds
43-
44-
def onPowerState(did, state):
45-
# Alexa, turn ON/OFF Device
46-
print(did, state)
47-
return True, state
48-
49-
50-
eventsCallbacks={
51-
"Events": Events
52-
}
53-
54-
callbacks = {
55-
'powerState': onPowerState
56-
}
57-
58-
if __name__ == '__main__':
59-
client = SinricPro(appKey, deviceId, callbacks,event_callbacks=eventsCallbacks, enable_trace=False,secretKey=secretKey)
60-
udp_client = SinricProUdp(callbacks,deviceId,enable_trace=False) # Set it to True to start logging request Offline Request/Response
61-
client.handle_all(udp_client)
19+
https://github.com/sinricpro/python-examples

setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
if sys.version_info < (3,6):
1212
sys.exit('Sorry, Python < 3.6 is not supported')
1313

14-
VERSION = "2.4.2"
14+
VERSION = "2.5.1"
1515

1616
with open('README.rst', 'r') as f:
1717
long_description = f.read()
@@ -20,11 +20,13 @@
2020
version=VERSION,
2121
author="Dhanush",
2222
author_email="dhanushdazz@gmail.com",
23-
description="A python package for your sinric-pro alexa skill",
23+
maintainer = 'sinric',
24+
maintainer_email = 'support@sinric.com',
25+
description="A python package for your Sinric Pro",
2426
long_description=long_description,
2527
url="https://github.com/sinricpro/python-sdk",
2628
packages=['sinric'],
27-
install_requires=["websockets","loguru"],
29+
install_requires=["websockets==8.1","loguru"],
2830
keywords=['alexa', 'alexa-skill', 'sinric', 'sinric-alexa-skill', 'alexa-home-automation', 'sinric-pro',
2931
'sinric-pro-alexa-skill'],
3032
classifiers=[

0 commit comments

Comments
 (0)