-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 1.0.5 --> New: Programm Smart Panels
- Loading branch information
Guido Diener
committed
Apr 8, 2018
1 parent
a118617
commit 1544f33
Showing
15 changed files
with
408 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,3 +105,7 @@ tox.ini | |
HowToUploadToPyPi.txt | ||
MANIFEST.in | ||
.pytest_cache/v/cache/lastfailed | ||
|
||
# vscode | ||
launch.json | ||
settings.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,29 @@ | ||
"""This is a Sample how to use the zeptrion Air Api.""" | ||
|
||
from zeptrionAirApi import ZeptrionAirHub | ||
|
||
hub = ZeptrionAirHub(3) #Initialize the ZeptrionAIrHub and browse for 5sec | ||
allZeptrionPanels = hub.get_all_panels() #returns all found panels | ||
allZeptrionChannels = hub.get_all_channels() #returns all found channels | ||
allLightChannels = hub.get_all_light_channels() #returns all found channels that are Light switches | ||
allGroups = hub.get_all_group() #returns all groups, that have been defined on the zeptrion app | ||
# Initialize the ZeptrionAIrHub and browse for 5sec | ||
hub = ZeptrionAirHub(3) | ||
# returns all found panels | ||
allZeptrionPanels = hub.get_all_panels() | ||
# returns all found channels | ||
allZeptrionChannels = hub.get_all_channels() | ||
# returns all found channels that are Light switches | ||
allLightChannels = hub.get_all_light_channels() | ||
# returns all groups, that have been defined on the zeptrion app | ||
allGroups = hub.get_all_group() | ||
for group in allGroups: | ||
output_to_return = "Channels in Group: " + str(group) | ||
hub.get_all_channels_by_group(group) #returns all channles that are defined for that group | ||
# returns all channles that are defined for that group | ||
hub.get_all_channels_by_group(group) | ||
|
||
channels = hub.get_all_channels_by_cat(1) #returns all found channels that are Light switches --> Category 1 | ||
channel = channels[0] #pick the first light | ||
channel.toggle_light() #toggle the light | ||
channel.turn_on_light() #turn the light on | ||
channel.turn_off_light() #turn the light off | ||
# returns all found channels that are Light switches --> Category 1 | ||
channels = hub.get_all_channels_by_cat(1) | ||
# pick the first light | ||
channel = channels[0] | ||
# toggle the light | ||
channel.toggle_light() | ||
# turn the light on | ||
channel.turn_on_light() | ||
# turn the light off | ||
channel.turn_off_light() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""This is the test for Smart Button.""" | ||
|
||
from zeptrionAirApi import ZeptrionAirHub | ||
import json | ||
|
||
hub = ZeptrionAirHub(3) # Initialize the ZeptrionAIrHub and browse for 5sec | ||
allZeptrionPanels = hub.get_all_panels() # returns all found panels | ||
# smartBtns = hub.get_all_smart_buttons() # returns all found smart buttons | ||
# hub.set_all_smart_buttons_to_program_mode() | ||
|
||
prog_elements = {} | ||
prog_elements['prog_req_type'] = 'POST' | ||
prog_elements['prog_url'] = '192.168.86.167' | ||
prog_elements['prog_path'] = '/test' | ||
prog_elements['prog_typ'] = 'application/json' | ||
prog_elements['prog_header_field'] = '' | ||
prog_elements['prog_port'] = '1880' | ||
body = {} | ||
body['state'] = 20 | ||
body['attributes'] = {} | ||
body['attributes']['unit_of_measurement'] = '°C' | ||
body['attributes']['friendly_name'] = 'Bathroom Temperature' | ||
prog_elements['prog_body'] = json.dumps(body) | ||
|
||
# result = hub.programm_smart_btn(prog_elements) | ||
# print(result) | ||
result = hub.get_panels_with_smart_button() | ||
print(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
"""This is the __init_.py file.""" | ||
|
||
# __init__.py | ||
#from zeptrionAirApi.zeptrion_air_hub import ZeptrionAirHub | ||
#from zeptrionAirApi.zeptrion_air_panel import zeptrion_air_panel | ||
#from zeptrionAirApi.zeptrion_air_channel import zeptrion_air_channel | ||
# from zeptrionAirApi.zeptrion_air_hub import ZeptrionAirHub | ||
# from zeptrionAirApi.zeptrion_air_panel import zeptrion_air_panel | ||
# from zeptrionAirApi.zeptrion_air_channel import zeptrion_air_channel |
Oops, something went wrong.