User Tools

Site Tools


Sidebar

dictionary:lists:unittype

Unit Type

Returns a 'list' of all units of a specified 'type'

Usage:

unit type (text, the type of unit from list of: all, real, dimmable, smart, analog, discrete, pseudo, blocked, simulated, security)

Optional Parameters:

with extract (returns a unit record with all data about the unit instead of just the name)
The Extract record is detailed here Unit Extract Record

Examples:

set MyUnitList to unit type "analog"
 
write log "we got this many analog units: " & (count of items of MyUnitList)
write log "and here are their names and current values:"
 
repeat with ThisUnitName in MyUnitList
  write log ThisUnitName & " has a value of " & (value of ThisUnitName)
end repeat

History:

2/25/17 removed reference to “wireless” and “passthrough” as those were legacy types with no important meaning in recent versions.

dictionary/lists/unittype.txt · Last modified: 2017/02/25 18:43 (external edit)