Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HomeKit API to Services setting #202

Merged
merged 3 commits into from
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,8 @@ function GetModal_Services($conn)
['name'=>'MySQL','service'=>'mysql.service'],
['name'=>'MariaDB','service'=>'mariadb.service'],
['name'=>'PiHome MQTT','service'=>'pihome.mqtt.service'],
['name'=>'Amazon Echo','service'=>'pihome_amazon_echo.service']];
['name'=>'Amazon Echo','service'=>'pihome_amazon_echo.service'],
['name'=>'HomeKit API','service'=>'pihome_homekit_api.service']];
echo '<div class="list-group">';
foreach($SArr as $SArrKey=>$SArrVal) {
echo '<span class="list-group-item">';
Expand Down Expand Up @@ -719,7 +720,7 @@ function GetModal_ServicesInfo($conn)
echo Convert_CRLF($rval['stdout'],'<br/>');
echo '</span></span>';

if($_GET['id']=='pihome.mqtt.service' or $_GET['id']=='pihome_amazon_echo.service') {
if($_GET['id']=='pihome.mqtt.service' or $_GET['id']=='pihome_amazon_echo.service' or $_GET['id']=='pihome_homekit_api.service') {
echo '<span class="list-group-item" style="overflow:hidden;">Install Service:';
echo '<span class="pull-right text-muted small">Edit /lib/systemd/system/' . $_GET['id'] . '<br/>
<code>sudo nano /lib/systemd/system/' . $_GET['id'] . '</code><br/>
Expand All @@ -729,18 +730,23 @@ function GetModal_ServicesInfo($conn)
<code>[Unit]<br/>';
if($_GET['id']=='pihome.mqtt.service') {
echo 'Description=PiHome MQTT Service<br/>';
} else {
} elseif($_GET['id']=='pihome_amazon_echo.service') {
echo 'Description=Amazon Echo Service<br/>';
} else {
echo 'Description=HomeKit API Service<br/>';
}
echo 'After=multi-user.target<br/>
<br/>
[Service]<br/>
Type=simple<br/>';
if($_GET['id']=='pihome.mqtt.service') {
echo 'ExecStart=/usr/bin/python -u /var/www/cron/mqtt.py<br/>';
} else {
} elseif($_GET['id']=='pihome_amazon_echo.service') {
echo 'ExecStart=/usr/bin/python -u /var/www/amazon_echo/echo_pihome.py<br/>';
}
else {
echo 'ExecStart=/usr/bin/python -u /var/www/homekit/homekit_api.py<br/>';
}
echo 'Restart=on-abort<br/>
<br/>
[Install]<br/>
Expand Down
2 changes: 1 addition & 1 deletion st_inc/db_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ dbname = pihome
connect_error = Sorry We are Experiencing MySQL Database Connection Problem...

version = 1.73
build = 290320
build = 060420