This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

easy way to search trough scenes?
#5
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>
Reply


Messages In This Thread
RE: easy way to search trough scenes? - by admin - Yesterday, 09:53

Forum Jump: