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, wireless, passThru, 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
dictionary/lists/unittype.txt · Last modified: 2009/09/28 08:38 by James Sentman
CC Attribution-No Derivative Works 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0