Skip to content

Commit

Permalink
Detect capes as "Unknown" and not "Unsupported"
Browse files Browse the repository at this point in the history
  • Loading branch information
dkulp committed May 17, 2019
1 parent d22f30b commit cd0e4a5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
Binary file added capes/other/Unknown-eeprom.bin
Binary file not shown.
File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/detect_cape
Expand Up @@ -80,7 +80,7 @@ function checkUnsupported($orig) {
return $orig;
}
if (HasI2CDevice("3c")) {
return "/opt/fpp/capes/unsupported/Unsupported-eeprom.bin";
return "/opt/fpp/capes/other/Unknown-eeprom.bin";
}
}
return $orig;
Expand Down Expand Up @@ -228,7 +228,7 @@ fclose($fp);
// also put the serialNumber into the cape-info for display
if (file_exists("/home/fpp/media/tmp/cape-info.json")) {
$json = json_decode(file_get_contents("/home/fpp/media/tmp/cape-info.json"));
if ($json->id != "Unsupported") {
if ($json->id != "Unsupported" && $json->id != "Unknown") {
$json->serialNumber = $capesn;
}
foreach($extras as $key => $value) {
Expand Down
8 changes: 5 additions & 3 deletions www/about.php
Expand Up @@ -297,11 +297,13 @@ function ToggleDeveloperMode() {
<legend>About Cape/Hat</legend>
<div style="overflow: hidden; padding: 10px;">
<div>
<div class='aboutLeft'>
<div class='<? if (isSet($currentCapeInfo['vendor'])) { echo "aboutLeft"; } else { echo "aboutAll";} ?> '>
<table class='tblAbout'>
<tr><td><b>Name:</b></td><td width="100%"><? echo $currentCapeInfo['name'] ?></td></tr>
<tr><td><b>Version:</b></td><td><? echo $currentCapeInfo['version'] ?></td></tr>
<?
if (isSet($currentCapeInfo['version'])) {
echo "<tr><td><b>Version:</b></td><td>" . $currentCapeInfo['version'] . "</td></tr>";
}
if (isSet($currentCapeInfo['serialNumber'])) {
echo "<tr><td><b>Serial&nbsp;Number:</b></td><td>" . $currentCapeInfo['serialNumber'] . "</td></tr>";
}
Expand All @@ -310,7 +312,7 @@ function ToggleDeveloperMode() {
}
if (isSet($currentCapeInfo['description'])) {
echo "<tr><td colspan=\"2\">";
if (isSet($currentCapeInfo['vendor'])) {
if (isSet($currentCapeInfo['vendor']) || $currentCapeInfo['name'] == "Unknown") {
echo $currentCapeInfo['description'];
} else {
echo htmlspecialchars($currentCapeInfo['description']);
Expand Down
5 changes: 5 additions & 0 deletions www/css/fpp.css
Expand Up @@ -218,6 +218,11 @@
float: left;
width: 47%;
}
.aboutAll{
float: left;
width: 95%;
}


html
{
Expand Down

0 comments on commit cd0e4a5

Please sign in to comment.