{{# hideroot will be True if we are displaying the device from the grid as a popup. In this we show the list without a border }} {{if d==null}} {{d=device_by_ref queries['ref']}} {{end}} {{if d==NULL}} {{d=device_by_ref refid}} {{end}} {{if d==null}} {{else}} {{if (devices_to_show d.ref)}} {{ignore_filters=queries['ignorefilters']}} {{hideroot=false}} {{if queries['hideroot'] != null}} {{if queries['hideroot']=="true"}} {{hideroot=true}} {{else}} {{hideroot=false}} {{end}} {{end}} {{if !hideroot}}
{{if location1_display_first}} {{d.location}} {{if use_location2}} | {{d.location2}} {{end}} {{else}} {{if use_location2}}{{d.location2}} | {{end}}{{d.location}} {{end}}
{{end}} {{if (hideroot && (d.version >= 4)) || (((get_setting_bool 'gHideDevices')=='checked') && d.marked_hidden)}} {{# for the dialog with device details, we display the device name at the top so we don't need to show the root device, unless its an HS3 device as that might have controls'}} {{else}} {{# root display for HS3 devices and HS4 devices in list view}}
{{-if !hideroot-}} {{-if (bulk_edit_enabled current_session)-}}
{{-end-}} {{-end-}} {{if d.version < 4}} {{# HS3 devices could have status and controls on the root so we need the icon}}
{{end}} {{if hideroot}} {{# we are displaying the feature in a dialog so keep the root smaller text}}
{{else}}    {{ if (device_misc_check d.primary_ref 8388608) || (device_misc_check d.primary_ref 4194304) }} {{# amazon discovery or google discovery }} {{else if device_misc_check d.primary_ref 512}} {{end}}
{{ status_text d.ref }}
{{if d.version < 4}} {{ last_change d.ref }} {{end}}
{{if (get_setting_bool 'gColCode') == 'checked'}}
{{device_address d.ref}}
{{end}}
{{controlsall d.ref}}
{{end}} {{-row=0-}} {{# order the features based on the set device priority}} {{devroot=device_by_ref d.ref}} {{devprilist=devroot.display_priority}} {{for devpri in devprilist}} {{c=(feature_by_device d.ref devpri.ref)}} {{if c.ref==d.ref}} {{# this is the root which we already displayed, so skip it}} {{continue}} {{end}} {{if (devpri.display_type == 'DISPLAY_HIDDEN') || (c.marked_hidden && ((get_setting_bool 'gHideDevices')=='checked'))}} {{continue}} {{end}} {{add_location=false}} {{if !((user_has_access_for_display c.ref user)=='checked')}} {{break}} {{end}} {{-if (ignore_filters=="true") || ( c.filter_match_child && !(c.marked_hidden && ((get_setting_bool 'gHideDevices')=='checked')) )-}} {{-device_count=device_count+1-}} {{-if (d.location != c.location || d.location2 != c.location2) || !d.filter_match_root-}}
{{if location1_display_first}} {{c.location}} {{if use_location2}} | {{c.location2}} {{end}} {{else}} {{if use_location2}}{{c.location2}} | {{end}}{{c.location}} {{end}}
{{add_location=false}} {{-end-}}
{{-if !hideroot-}} {{-if (bulk_edit_enabled current_session)-}}
{{-end-}} {{-end-}}   {{~c.name~}}{{~if (get_setting_bool 'gEnableDeviceRefColumn') == 'checked'~}} ({{~c.ref~}}){{~end~}}    {{ if (device_misc_check c.ref 8388608) || (device_misc_check c.ref 4194304) }} {{# amazon discovery or google discovery }} {{else if device_misc_check c.ref 512}} {{end}}
{{status_text c.ref}}
{{last_change c.ref}}
{{if (get_setting_bool 'gColCode') == 'checked'}}
{{device_address c.ref}}
{{-end-}}
{{-controlsall c.ref-}}
{{-end-}} {{-end-}} {{if !hideroot}}
{{end}} {{end}} {{end}}