#Device
The device
library provides actions that can be performed on the client device.
local dev = require("device");
In most cases WOL (Wake On LAN) needs to be sent without being connected to a server (i.e if the server is sleeping and you wish to wake it up). Therefore WOL actions should be specified in the layout. See Inline Actions to learn more about this syntax.
<layout>
<button text="WOL" onclick="@wol" />
</layout>
If no mac
is specified, then the last used server's mac will be used. Otherwise, the specified mac will be used.
<layout>
<button text="WOL" onclick="@wol,00:00:00:00:00:00:00:00" />
</layout>
Send an IR code (pronto format) using the device's built-in IR blaster (if available).
dev.irsend("0000 0000 0000 0000");
<layout>
<button text="IR" onclick="@irsend,0000 006b 0026 0000 0154 00aa 0015 0015..." />
</layout>
Opens the keyboard remote on the device.
dev.keyboard();
Opens the mouse remote on the device.
dev.mouse();
Opens the remote with the specified id
on the device.
dev.switch("Unified.Chrome");
Tells the device to perform haptic feedback.
dev.vibrate();
Tells the device to start listening for voice control (if available).
dev.listen();
Shows a quick message (toast) on the device.
dev.toast("foobar");
Connect to the specified server (exact name).
dev.server("Home-PC");