Skip to content

Commit bdbbfda

Browse files
[service.projcontrol] 1.4.0
1 parent 3e2a344 commit bdbbfda

File tree

22 files changed

+2578
-0
lines changed

22 files changed

+2578
-0
lines changed

service.projcontrol/LICENSE

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Copyright (c) 2015, Fredrik Eriksson
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
10+
* Redistributions in binary form must reproduce the above copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
14+
* Neither the name of kodi_projcontrol nor the names of its
15+
contributors may be used to endorse or promote products derived from
16+
this software without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
29+
30+
---
31+
32+
Note that icon.png is taken from Googles Noto Emoji Objects Icons, and is
33+
licensed under a different license. Icon has been modified from the original;
34+
it has been resized and transparent areas has been colored black.
35+
See icon_license.txt for icon license terms.

service.projcontrol/README.rst

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
Projector Control for Kodi
2+
==========================
3+
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.
4+
5+
Features
6+
--------
7+
* Power on, off and set input on the projector when kodi starts/exits and/or screensaver activates/deactivates
8+
* Automatically update library when projector is shut down
9+
* Do regular library updates as long as the projector is shut down
10+
* Power on, off or toggle projector using a REST API
11+
* Change input source of the projector using a REST API
12+
13+
Requirements
14+
------------
15+
* py-serial
16+
* bottle
17+
* A supported projector connected over serial interface
18+
* Kodi installation (only tested on Linux)
19+
20+
Supported Projectors
21+
--------------------
22+
It should be a trivial task to add support for more projectors with serial connections. However I can't test any new implementation
23+
without having a projector of that model. While I wouldn't mind if you send me
24+
projectors of different brands and models, you will probably find it cheaper to learn a little python and implement it yourself.
25+
PR:s are always welcome.
26+
27+
That said; if you have a projector that you want support for, please create a github
28+
issue at https://github.com/fredrik-eriksson/kodi_projcontrol. At minimum the following information is required to implement
29+
support for a projector:
30+
31+
* connection settings (baudrate, bytesize, parity and stopbits)
32+
* command syntax
33+
* response syntax (for both get and set commands)
34+
* how to verify projector is accepting commands (if possible)
35+
* how to detect and handle error-responses
36+
37+
Below is a list of currently supported projectors
38+
39+
Epson
40+
#####
41+
* TW3200
42+
* PowerLite 820p
43+
44+
InFocus
45+
#######
46+
* IN72/IN74/IN76
47+
48+
Acer
49+
####
50+
* X1373WH
51+
* V7500
52+
53+
BenQ
54+
####
55+
* M535 series
56+
57+
Usage
58+
-----
59+
Copy repository to your Kodi addon directory (usually ~/.kodi/addons) and rename it to 'service.projcontrol'.
60+
61+
REST API
62+
--------
63+
Note if you use the REST API: the api provides absolutely no security; never enable it on untrusted network.
64+
65+
After configuring and enabling the REST API from Kodi you can test it using curl
66+
67+
.. code-block:: shell
68+
69+
# Check power status and input source
70+
$ curl http://10.37.37.13:6661/power
71+
{
72+
"power": true,
73+
"source": "HDMI1"
74+
}
75+
76+
# Controlling power with POST request. Valid commands are "on", "off" or "toggle"
77+
$ curl -i -H "Content-Type: application/json" -X POST -d '"off"' http://10.37.37.13:6661/power
78+
HTTP/1.0 200 OK
79+
Content-Type: application/json
80+
Content-Length: 21
81+
Server: Werkzeug/0.9.6 Python/2.7.9
82+
Date: Mon, 09 Nov 2015 18:54:03 GMT
83+
84+
{
85+
"success": true
86+
}
87+
88+
# Check valid input sources
89+
$ curl http://10.37.37.13:6661/source
90+
{
91+
"sources": [
92+
"PC",
93+
"HDMI1",
94+
"Component - YCbCr",
95+
"HDMI2",
96+
"Component - YPbPr",
97+
"Video",
98+
"S-Video",
99+
"Component",
100+
"Component - Auto",
101+
"RCA"
102+
]
103+
}
104+
105+
# Set input source
106+
$ curl -i -H "Content-Type: application/json" -X POST -d '"HDMI1"' http://10.37.37.13:6661/source
107+
HTTP/1.0 200 OK
108+
Content-Type: application/json
109+
Content-Length: 21
110+
Server: Werkzeug/0.9.6 Python/2.7.9
111+
Date: Mon, 09 Nov 2015 18:54:03 GMT
112+
113+
{
114+
"success": true
115+
}

service.projcontrol/addon.xml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<addon id="service.projcontrol"
3+
name="Projector Control"
4+
version="1.4.0"
5+
provider-name="Fredrik Eriksson">
6+
<requires>
7+
<import addon="xbmc.python" version="3.0.0"/>
8+
<import addon="script.module.bottle" version="0.12.8"/>
9+
<import addon="script.module.pyserial" version="3.4.0"/>
10+
</requires>
11+
<extension point="xbmc.service" library="service.py" />
12+
<extension point="xbmc.addon.metadata">
13+
<platform>all</platform>
14+
<summary lang="en_GB">Control your projector from Kodi</summary>
15+
<summary lang="sv_SE">Hantera din projektor med Kodi</summary>
16+
<summary lang="nb_NO">Styr prosjektøren din med Kodi</summary>
17+
<summary lang="de_DE">Kontrolliere deinen Beamer mit Kodi</summary>
18+
<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>
19+
<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>
20+
<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>
21+
<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>
22+
23+
<news>
24+
v1.4.0 - 2022-11-17
25+
- Kodi 19 support
26+
- Add support for BenQ projectors
27+
- Add support for Acer projectors
28+
29+
v1.3.0 - 2018-08-16
30+
- replaced flask dependency with bottle
31+
- some restructuring
32+
- other changes required for inclusion in official Kodi repository
33+
34+
v1.2.0 - 2018-07-09
35+
- Made strings localizeable (is that a word?) and added Swedish translation
36+
- Made API service optional
37+
- Add support to turn on/off projector at Kodi startup and shutdown
38+
- Add support to turn on/off projector at screensaver (de)activation
39+
- Add support for InFocus projectors IN72/IN74/IN76
40+
41+
v1.1.0 - 2015-11-09
42+
- Replace twisted with flask
43+
- Use py-serial to configure serial port
44+
- fixed regular library updates
45+
46+
v1.0.0 - 2015-06-27
47+
- Initial release
48+
</news>
49+
<license>BSD-3-Clause</license>
50+
<source>https://github.com/fredrik-eriksson/kodi_projcontrol</source>
51+
<assets>
52+
<icon>icon.png</icon>
53+
</assets>
54+
</extension>
55+
56+
</addon>

service.projcontrol/icon.png

36.5 KB
Loading

0 commit comments

Comments
 (0)