Skip to content

Commit

Permalink
[service.projcontrol] 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrik-eriksson committed Nov 17, 2022
1 parent 3e2a344 commit 2a7cebd
Show file tree
Hide file tree
Showing 22 changed files with 2,578 additions and 0 deletions.
35 changes: 35 additions & 0 deletions service.projcontrol/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Copyright (c) 2015, Fredrik Eriksson
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of kodi_projcontrol nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


---

Note that icon.png is taken from Googles Noto Emoji Objects Icons, and is
licensed under a different license. Icon has been modified from the original;
it has been resized and transparent areas has been colored black.
See icon_license.txt for icon license terms.
115 changes: 115 additions & 0 deletions service.projcontrol/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
Projector Control for Kodi
==========================
Service add-on to Kodi for controling projectors with an optional RESTful API. This is intended to be used on stand-alone media centers running Kodi.

Features
--------
* Power on, off and set input on the projector when kodi starts/exits and/or screensaver activates/deactivates
* Automatically update library when projector is shut down
* Do regular library updates as long as the projector is shut down
* Power on, off or toggle projector using a REST API
* Change input source of the projector using a REST API

Requirements
------------
* py-serial
* bottle
* A supported projector connected over serial interface
* Kodi installation (only tested on Linux)

Supported Projectors
--------------------
It should be a trivial task to add support for more projectors with serial connections. However I can't test any new implementation
without having a projector of that model. While I wouldn't mind if you send me
projectors of different brands and models, you will probably find it cheaper to learn a little python and implement it yourself.
PR:s are always welcome.

That said; if you have a projector that you want support for, please create a github
issue at https://github.com/fredrik-eriksson/kodi_projcontrol. At minimum the following information is required to implement
support for a projector:

* connection settings (baudrate, bytesize, parity and stopbits)
* command syntax
* response syntax (for both get and set commands)
* how to verify projector is accepting commands (if possible)
* how to detect and handle error-responses

Below is a list of currently supported projectors

Epson
#####
* TW3200
* PowerLite 820p

InFocus
#######
* IN72/IN74/IN76

Acer
####
* X1373WH
* V7500

BenQ
####
* M535 series

Usage
-----
Copy repository to your Kodi addon directory (usually ~/.kodi/addons) and rename it to 'service.projcontrol'.

REST API
--------
Note if you use the REST API: the api provides absolutely no security; never enable it on untrusted network.

After configuring and enabling the REST API from Kodi you can test it using curl

.. code-block:: shell
# Check power status and input source
$ curl http://10.37.37.13:6661/power
{
"power": true,
"source": "HDMI1"
}
# Controlling power with POST request. Valid commands are "on", "off" or "toggle"
$ curl -i -H "Content-Type: application/json" -X POST -d '"off"' http://10.37.37.13:6661/power
HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 21
Server: Werkzeug/0.9.6 Python/2.7.9
Date: Mon, 09 Nov 2015 18:54:03 GMT
{
"success": true
}
# Check valid input sources
$ curl http://10.37.37.13:6661/source
{
"sources": [
"PC",
"HDMI1",
"Component - YCbCr",
"HDMI2",
"Component - YPbPr",
"Video",
"S-Video",
"Component",
"Component - Auto",
"RCA"
]
}
# Set input source
$ curl -i -H "Content-Type: application/json" -X POST -d '"HDMI1"' http://10.37.37.13:6661/source
HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 21
Server: Werkzeug/0.9.6 Python/2.7.9
Date: Mon, 09 Nov 2015 18:54:03 GMT
{
"success": true
}
56 changes: 56 additions & 0 deletions service.projcontrol/addon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="service.projcontrol"
name="Projector Control"
version="1.4.0"
provider-name="Fredrik Eriksson">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.bottle" version="0.12.8"/>
<import addon="script.module.pyserial" version="3.4.0"/>
</requires>
<extension point="xbmc.service" library="service.py" start="login" />
<extension point="xbmc.addon.metadata">
<platform>all</platform>
<summary lang="en_GB">Control your projector from Kodi</summary>
<summary lang="sv_SE">Hantera din projektor med Kodi</summary>
<summary lang="nb_NO">Styr prosjektøren din med Kodi</summary>
<summary lang="de_DE">Kontrolliere deinen Beamer mit Kodi</summary>
<description lang="en_GB">From Kodi, control a projector connected via a serial port. See https://github.com/fredrik-eriksson/kodi_projcontrol for supported projectors and features.</description>
<description lang="sv_SE">Hantera en projektor ansluten via serieport, via Kodi. Se https://github.com/fredrik-eriksson/kodi_projcontrol (Endast på engelska) för vilka projektorer och funktioner som stöds.</description>
<description lang="nb_NO">Styr en prosjektør som er koblet til Kodi via seriellport. Se https://github.com/fredrik-eriksson/kodi_projcontrol (kun på engelsk) over oversikt over hvilke prosjektører og funksjoner som støttes.</description>
<description lang="de_CH">Kontrolliere deinen mit einem seriellen Port verbundenen Beamer mit Kodi. Siehe unter https://github.com/fredrik-eriksson/kodi_projcontrol (nur in englisch) nach unterstützten Beamer und Funktionen.</description>

<news>
v1.4.0 - 2022-11-17
- Kodi 19 support
- Add support for BenQ projectors
- Add support for Acer projectors

v1.3.0 - 2018-08-16
- replaced flask dependency with bottle
- some restructuring
- other changes required for inclusion in official Kodi repository

v1.2.0 - 2018-07-09
- Made strings localizeable (is that a word?) and added Swedish translation
- Made API service optional
- Add support to turn on/off projector at Kodi startup and shutdown
- Add support to turn on/off projector at screensaver (de)activation
- Add support for InFocus projectors IN72/IN74/IN76

v1.1.0 - 2015-11-09
- Replace twisted with flask
- Use py-serial to configure serial port
- fixed regular library updates

v1.0.0 - 2015-06-27
- Initial release
</news>
<license>BSD-3-Clause</license>
<source>https://github.com/fredrik-eriksson/kodi_projcontrol</source>
<assets>
<icon>icon.png</icon>
</assets>
</extension>

</addon>
Binary file added service.projcontrol/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2a7cebd

Please sign in to comment.