New config option - select remote controller.

This commit is contained in:
Pecusx
2016-11-09 20:58:55 +01:00
committed by GitHub
parent e6db1197f8
commit a91ba2ac59
2 changed files with 52 additions and 0 deletions
+27
View File
@@ -18,6 +18,33 @@ Audio device config<br>
</pre>
</form>
<hr>
Remote config<br>
<form action="changeconf.php?file=remote" method="post">
<pre>
<?php
$remote = file_get_contents( "/etc/lirc/lircd.conf" );
preg_match('/\n# *brand: *.*/', $remote, $matches);
$currentremotename = preg_replace("/\n# *brand: */", "", $matches[0]);
$dir = '/usr/share/radio/hardware/remotes/';
$remoteconfigs = scandir($dir);
for ($i = 0; $i < count($remoteconfigs); $i++) {
if (preg_match('/.conf/',$remoteconfigs[$i])) {
$remote = file_get_contents( "/usr/share/radio/hardware/remotes/".$remoteconfigs[$i] );
preg_match('/\n# *brand: *.*/', $remote, $matches);
$remotename = preg_replace("/\n# *brand: */", "", $matches[0]);
echo ' <input type="radio" name="remote" value="';
echo $remoteconfigs[$i].'"';
if ($remotename==$currentremotename) {
echo ' checked';
}
echo "> ".$remotename."\n";
}
}
?>
<br><button type="submit" name="submit">Save remote config and reboot</button>
</pre>
</form>
<hr>
Update to last build from github
<a href="update.php"><button>PiRadio update</button></a>
<hr>