Yesterday, 09:53
Try this:
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/apps/css/bootstrap.css.gz">
<style>body { padding: 20px 20px 0 20px; }</style>
<title>Homekit</title>
</head>
<body>
<table class="table">
<?
require('apps')
devices = storage.exec('hgetall', 'app:homekit:devices')
for _, device in pairs(devices) do
props = json.pdecode(device) or {}
?>
<tr class="bg-primary">
<td colspan="2"><b><?=escape(props.name)?></b> (<?=escape(props.type)?>)</td>
</tr>
<?
for key, val in pairs(props) do
if (key:find('_status') or key:find('_control')) and type(val) == 'string' and #val > 0 then
?>
<tr>
<td><?=escape(key)?></td>
<td><?=escape(val)?></td>
</tr>
<?
end
end
end
?>
</table>
</body>
</html>