JavaScript API

From MiOS
(Difference between revisions)
Jump to: navigation, search
m (jsonp.ud)
m
Line 35: Line 35:
 
'''Input:'''
 
'''Input:'''
 
* str (string): text to be written in the console. You need to have FireBug installed.
 
* str (string): text to be written in the console. You need to have FireBug installed.
 +
'''Output:'''
 +
* nothing
 +
 +
 +
==== set_panel_html (html) ====
 +
Used in the tab rendering functions.
 +
'''Input:'''
 +
* html (string): The html to be used for generating the tab content.
 
'''Output:'''
 
'''Output:'''
 
* nothing
 
* nothing

Revision as of 17:33, 1 April 2011

Contents

Variables

jsonp.ud

  • Type: table
  • Description: This is the user data.
  • Members:
    • devices (table)
    • scenes (table)
    • rooms (table)
    • users (table)
    • eventList (table)
    • etc.

Functions

get_device_state (deviceID, service, variable, dynamic)

Input:

  • deviceID (number)
  • service (string)
  • variable (string)
  • dynamic (number): if 1 the variable value is taken from lu_status, else the variable value is taken from user_data (recommended). user_data is read at Luup startup, so for variables that change their value frequently (like Watts, Temperature, etc.) dynamic should be 1.

Output:

  • variable value (string or undefined)


set_device_state (deviceID, service, variable, value)

Input:

  • deviceID (number)
  • service (string)
  • variable (string)
  • value (string)

Output:

  • true if the operation succeeded, false otherwise


_console (str)

Input:

  • str (string): text to be written in the console. You need to have FireBug installed.

Output:

  • nothing


set_panel_html (html)

Used in the tab rendering functions. Input:

  • html (string): The html to be used for generating the tab content.

Output:

  • nothing
Personal tools