Skip to content

Latest commit

 

History

History
118 lines (74 loc) · 2.01 KB

device.md

File metadata and controls

118 lines (74 loc) · 2.01 KB

#Device

device

The device library provides actions that can be performed on the client device.

local dev = require("device");

device.wol( [mac] )

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>

device.irsend( code )

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>

device.keyboard()

Opens the keyboard remote on the device.

dev.keyboard();

device.mouse()

Opens the mouse remote on the device.

dev.mouse();

device.switch( id )

Opens the remote with the specified id on the device.

dev.switch("Unified.Chrome");

device.vibrate()

Tells the device to perform haptic feedback.

dev.vibrate();

device.listen()

Tells the device to start listening for voice control (if available).

dev.listen();

device.toast( message )

Shows a quick message (toast) on the device.

dev.toast("foobar");

device.server( name )

Connect to the specified server (exact name).

dev.server("Home-PC");