JavaScript API

From MiOS
(Difference between revisions)
Jump to: navigation, search
m
Line 11: Line 11:
  
  
==== set_device_state (deviceID, service, variable, value, dynamic) ====
+
==== set_device_state (deviceID, service, variable, value) ====
 
'''Input:'''
 
'''Input:'''
 
* deviceID (number)
 
* deviceID (number)

Revision as of 16:37, 1 April 2011

Contents

Variables

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
Personal tools