{{includefile 'bootstrap/css/page_common.css'}} Devices {{includefile 'header.html'}}
{{includefile 'navbar.html'}}
{{if location1_display_first}} {{else}} {{end}}
{{if ((array.size (selected_location2 current_session)) != 0) || ((array.size (selected_location current_session)) != 0) || ((array.size (selected_category current_session)) != 0) || ((array.size (selected_filter current_session)) != 0)}} {{end}}
{{sortmode=(sort_mode_current)}}
{{if user_access_by_rights 1 user}} {{else}} {{end}} {{if user_access_by_rights 1 user}} {{else}} {{if device_view_format=="List"}} {{if (bulk_edit_enabled current_session)}} {{else}} {{end}} {{end}} {{end}} {{if (get_setting_bool 'gHideDevices') == 'checked'}} {{else}} {{end}}
{{ if device_view_format=="Grid" }}
{{device_count_root=0}} {{devices_local = (devices sort_mode_current true)}} {{~ for d in devices_local ~}} {{match=false}} {{if d.filter_match_root}} {{match=true}} {{end}} {{if !match}} {{for c in d.children}} {{if c.filter_match_child}} {{match=true}} {{end}} {{end}} {{end}} {{if (d.marked_hidden && ((get_setting_bool 'gHideDevices')=='checked'))}} {{match=false}} {{end}} {{if !((user_has_access_for_display d.ref user)=='checked')}} {{match=false}} {{end}} {{if match}} {{device_count_root=device_count_root+1}}
{{if d.device_api==512 && d.edevice_type==10}} {{else}}
0}} onclick="show_children({{ d.primary_ref }})" {{end}} data-toggle="modal" data-target="#childcontrol" class="{{if (array.size d.children)>0}}fa-point{{end}} text-right col mr-2 devices_children_icon d-xl-inline-block float-xl-none border border-top-0 border-right-0 border-left-0 pb-1"> {{if (d.version < 4) && ((user_has_access_for_display d.ref user)=='checked') && (d.primary_ref != d.ref)}} {{ if (d.device_api==513 && (d.edevice_type==16 || d.edevice_type==17)) }} {{else}} {{ if d.status_suffix=='%' || d.status_suffix=='@S@' }} {{ d.status }} {{ end }} {{end}} {{end}} {{ for c in d.children }} {{if (user_has_access_for_display c.ref user)=='checked'}} {{ if (c.device_api==513 && (c.edevice_type==16 || c.edevice_type==17)) }} {{else}} {{ if c.status_suffix=='%' || c.status_suffix=='@S@' }} {{ c.status }} {{ end }} {{end}} {{end}} {{ end }} {{ if d.child_count == 0 }} {{ end }}
{{end}}
{{if location1_display_first}} {{d.location}} {{if use_location2}} | {{d.location2}} {{end}} {{else}} {{if use_location2}}{{d.location2}} | {{end}}{{d.location}} {{end}}
{{ if (d.device_api==512 && (d.edevice_type==8 || d.edevice_type==10)) }} {{ else }}
{{dvp=device_by_ref d.primary_ref}}
{{ status_text d.primary_ref }}
{{ end }} {{ if (d.device_api==512 && d.edevice_type==8) }} {{have_heat=false}} {{have_cool=false}} {{have_autochangeover=false}} {{have_mode=false}} {{have_fan=false}} {{ for c in d.children }} {{if c.edevice_type==17}} {{if c.device_sub_type==1}} {{have_heat=true}} {{end}} {{if c.device_sub_type==2}} {{have_cool=true}} {{end}} {{if c.device_sub_type==10}} {{have_autochangeover=true}} {{end}} {{if c.device_sub_type==3}} {{have_mode=true}} {{end}} {{if c.device_sub_type==4}} {{have_fan=true}} {{end}} {{end}} {{end}}
{{if have_heat || have_autochangeover}} {{end}}
{{if have_cool}} {{end}}
{{if have_heat}} {{ therm_current_heat_set d.ref }} {{else if have_autochangeover}} {{ therm_current_autochangeover_set d.ref}} {{end}}
{{ therm_current_temp d.ref }}
{{if have_cool}} {{ therm_current_cool_set d.ref }} {{end}}
{{if have_heat || have_autochangeover}} {{end}}
{{if have_cool}} {{end}}
{{if have_mode}}
{{ therm_mode_status_image d.ref }}
{{ therm_mode_controls d.ref }}
{{end}} {{if have_fan}}
{{ therm_fan_status_image d.ref }}
{{ therm_fan_controls d.ref }}
{{end}} {{ else if (d.device_api==512 && d.edevice_type==10) }}
{{ for c in d.children }} {{if c.device_sub_type==14}} {{c.status_short}} {{end}} {{end}}
{{ for c in d.children }} {{if c.device_sub_type==3}} {{for p in c.vspairs}} {{if p.control_use=='_Previous'}}
{{end}} {{if p.control_use=='_Pause'}}
{{end}} {{if p.control_use=='_Play'}}
{{end}} {{if p.control_use=='_Next'}}
{{end}} {{end}} {{end}} {{end}}
{{ for c in d.children }} {{if c.device_sub_type==4}} {{for p in c.vspairs}} {{if p.control_use=='_Volume'}}
{{end}} {{end}} {{end}} {{end}} {{ for c in d.children }} {{if c.device_sub_type==13 || c.device_sub_type==4}} {{havetoggle=false}} {{for p in c.vspairs}} {{if p.control_use=='_MuteToggle'}} {{havetoggle=true}}
{{if (device_value c.ref)==0}} {{end}} {{if (device_value c.ref)==1}} {{end}}
{{end}} {{end}} {{if !havetoggle}} {{for p in c.vspairs}} {{if p.control_use=='_Mute'}} {{end}} {{if p.control_use=='_UnMute'}} {{end}} {{end}} {{end}} {{end}} {{end}}
{{ else }}
{{ controls_row d.primary_ref 1 }}
{{ controls_row d.primary_ref 2}}
{{ controls_row d.primary_ref 3}}
{{ end }}
{{ last_change d.primary_ref }} {{ vc=(device_enabled_for_voice d.primary_ref) }} {{ if vc != '' }}    {{end}}
{{end}} {{if device_count_root > (get_setting_int 'gMaxDevicesForDisplay')}} {{limit_reached=true}} {{break}} {{end}} {{~ end ~}}
{{ else }} {{if (bulk_edit_enabled current_session)}}
{{end}} {{limit_reached=false}} {{device_count=0}} {{devices_local = (devices sort_mode_current false)}} {{border='
'}} {{-for d in devices_local-}} {{if !((user_has_access_for_display d.ref user)=='checked')}} {{break}} {{end}} {{-border_added=false-}} {{-if d.filter_match_root && !(d.marked_hidden && ((get_setting_bool 'gHideDevices')=='checked'))-}} {{-border-}} {{-border_added=true-}} {{-device_count=device_count+1-}}
{{d.location2}} | {{d.location}}
{{ 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-}} {{~for c in d.children~}} {{add_location=false}} {{if !((user_has_access_for_display c.ref user)=='checked')}} {{break}} {{end}} {{-if c.filter_match_child && !(c.marked_hidden && ((get_setting_bool 'gHideDevices')=='checked'))-}} {{-if !border_added-}} {{-border-}} {{-border_added=true-}} {{add_location=true}} {{-end-}} {{-device_count=device_count+1-}} {{-if (d.location != c.location || d.location2 != c.location2) || !d.filter_match_root || add_location-}}
{{c.location2}} | {{c.location}}
{{add_location=false}} {{-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 border_added}}
{{end}} {{if device_count > (get_setting_int 'gMaxDevicesForDisplay')}} {{limit_reached=true}} {{break}} {{end}} {{~end~}} {{end}} {{ if device_view_format==0 }}
Showing {{device_count_root}} of {{array.size devices_local}} Devices
{{else}}
Showing {{device_count}} of {{total_devices_features current_session}} Devices/Features
{{end}} {{if limit_reached}}
Note: Device display limit of {{get_setting_int 'gMaxDevicesForDisplay'}} devices reached, not all devices are shown
{{end}}
{{if (bulk_edit_enabled current_session)}} {{end}}
{{includefile 'bootstrap/js/page_common.js'}}