Skip to content

Commit

Permalink
1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
thehappydinoa committed Jul 19, 2018
1 parent 1550467 commit 9787370
Show file tree
Hide file tree
Showing 5 changed files with 172 additions and 37 deletions.
131 changes: 129 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,131 @@
*.pyc
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
itachip2ir.egg-info/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
27 changes: 17 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
itachip2ir v1.2.0
=================
itachip2ir v1.3.0
=================
A small Python module for interacting with the Global Caché iTach WF2IR or IP2IR

==========
How To Use
=================
==========
.. code-block:: python
from itachip2ir import iTach, device
from itachip2ir import VirtualDevice, iTach
commands = {
"toggle_power": "sendir,1:3,1,40192,1,1,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,529,96,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,528,96,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,553,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,554,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,554,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,554,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,4000"
}
blueray_commands = {
"toggle_power": ""
}
itach = iTach(ip="localhost", port=4998)
itach = iTach(ipaddress="192.168.1.111", port=4998)
blueray = itach.add(VirtualDevice(
name="blueray", commands=blueray_commands))
print(stereo.send_command("on"))
name="blueray", commands=commands))
if __name__ == "__main__":
print(blueray.toggle_power())
Check the examples folder for more
Check the ``examples/`` folder for more

`The source for this project is available here
<https://github.com/thehappydinoa/itachip2ir>`_.
16 changes: 8 additions & 8 deletions examples/blueray.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python2.7
from itachip2ir import iTach, device
from itachip2ir import VirtualDevice, iTach

commands = {
"toggle_power": "sendir,1:3,1,40192,1,1,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,529,96,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,528,96,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,553,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,554,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,554,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,554,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,4000"
}

def bluerayTest():
itach = iTach("Tester iTach ip2ir", "192.168.1.12")
blueray = device("Blueray Player", itach)
blueray.set_command("toggle_power", "sendir,1:3,1,40192,1,1,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,529,96,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,528,96,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,553,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,554,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,554,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,554,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,49,23,49,23,49,4000")
blueray.send_commands("toggle_power", 3)
itach = iTach(ipaddress="192.168.1.111", port=4998)
blueray = itach.add(VirtualDevice(
name="blueray", commands=commands))


if __name__ == "__main__":
bluerayTest()
print(blueray.toggle_power())
31 changes: 16 additions & 15 deletions examples/stereo.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
#!/usr/bin/env python2.7
from itachip2ir import iTach, device
from itachip2ir import VirtualDevice, iTach

commands = {
"toggle_power": "sendir,1:3,7,40064,1,1,96,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,908,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,908,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,908,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,908,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,908,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,4000",
"toggle_mute": "sendir,1:3,1,40192,1,1,97,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,912,96,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,912,96,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,934,97,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,935,97,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,935,97,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,4000",
"volume_up": "sendir,1:3,2,40192,1,1,97,23,25,23,49,23,25,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,915,96,23,25,23,49,23,25,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,912,96,23,25,23,49,23,25,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,932,97,23,25,23,49,23,25,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,4000",
"volume_down": "sendir,1:3,8,40192,1,1,97,23,49,23,49,23,25,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,891,96,23,49,23,49,23,25,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,888,96,23,49,23,49,23,25,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,4000",
"input_sat": "sendir,1:3,1,40192,1,1,97,23,49,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,49,898,96,23,49,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,49,888,96,23,49,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,49,921,97,23,49,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,49,921,97,23,49,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,49,921,97,23,49,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,49,921,97,23,49,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,49,4000",
"input_tv": "sendir,1:3,1,40192,1,1,97,23,25,23,49,23,25,23,49,23,25,23,49,23,49,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,874,96,23,25,23,49,23,25,23,49,23,25,23,49,23,49,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,864,96,23,25,23,49,23,25,23,49,23,25,23,49,23,49,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,897,97,23,25,23,49,23,25,23,49,23,25,23,49,23,49,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,897,97,23,25,23,49,23,25,23,49,23,25,23,49,23,49,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,897,97,23,25,23,49,23,25,23,49,23,25,23,49,23,49,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,897,97,23,25,23,49,23,25,23,49,23,25,23,49,23,49,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,4000",
"input_bd": "sendir,1:3,1,40192,2,1,97,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,25,23,25,628,96,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,25,23,25,624,96,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,25,23,25,660,97,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,25,23,25,660,97,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,25,23,25,4000"
}

def stereoTest():
itach = iTach("Tester iTach ip2ir", "192.168.1.12")
stereo = device("Stereo", itach)
stereo.set_command("toggle_power", "sendir,1:3,7,40064,1,1,96,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,908,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,908,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,908,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,908,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,908,97,23,49,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,4000")
stereo.set_command("input_sat", "sendir,1:3,1,40192,1,1,97,23,49,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,49,898,96,23,49,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,49,888,96,23,49,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,49,921,97,23,49,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,49,921,97,23,49,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,49,921,97,23,49,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,49,921,97,23,49,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,49,4000")
stereo.set_command("input_tv", "sendir,1:3,1,40192,1,1,97,23,25,23,49,23,25,23,49,23,25,23,49,23,49,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,874,96,23,25,23,49,23,25,23,49,23,25,23,49,23,49,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,864,96,23,25,23,49,23,25,23,49,23,25,23,49,23,49,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,897,97,23,25,23,49,23,25,23,49,23,25,23,49,23,49,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,897,97,23,25,23,49,23,25,23,49,23,25,23,49,23,49,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,897,97,23,25,23,49,23,25,23,49,23,25,23,49,23,49,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,897,97,23,25,23,49,23,25,23,49,23,25,23,49,23,49,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,4000")
stereo.set_command("input_bd", "sendir,1:3,1,40192,2,1,97,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,25,23,25,628,96,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,25,23,25,624,96,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,25,23,25,660,97,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,25,23,25,660,97,23,25,23,49,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,25,23,25,23,25,23,49,23,25,23,49,23,25,23,25,4000")
stereo.set_command("toggle_mute", "sendir,1:3,1,40192,1,1,97,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,912,96,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,912,96,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,934,97,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,935,97,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,935,97,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,4000")
stereo.set_command("volume_up", "sendir,1:3,1,40192,1,1,97,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,912,96,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,912,96,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,934,97,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,935,97,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,935,97,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,4000")
stereo.set_command("volume_down", "sendir,1:3,1,40192,1,1,97,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,912,96,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,912,96,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,934,97,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,935,97,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,935,97,23,25,23,25,23,49,23,25,23,49,23,25,23,25,23,25,23,25,23,25,23,25,23,49,23,49,23,25,23,25,4000")

stereo.send_command("toggle_power")
itach = iTach(ipaddress="192.168.1.111", port=4998)
stereo = itach.add(VirtualDevice(
name="stereo", commands=commands))


if __name__ == "__main__":
stereoTest()
print(stereo.toggle_power())
print(stereo.volume_up())
print(stereo.volume_down())
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name='itachip2ir',
version='1.3.0',
version='1.3.1',
description='A small Python module for interacting with the Global Cache iTach WF2IR or IP2IR',
long_description=long_description,
url='https://github.com/thehappydinoa/itachip2ir',
Expand All @@ -36,7 +36,7 @@
'Programming Language :: Python :: 3.7',
],

keywords='itach ip2ir Global Cache',
keywords='itach ip2ir Global Cache ir smart-home',

packages=find_packages(exclude=['contrib', 'docs', 'tests', "examples"]),

Expand Down

0 comments on commit 9787370

Please sign in to comment.