def settings_devices_selection(grpnum, dvcnum):
    #
    body = '<div class="row">'
    count = 0
    devices = read_list_devices()
    #
    device_keys = devices.keys()
    #
    for dvc_key in device_keys:
        if count> 0 and count % 4 == 0:
            body += '</div><div class="row">'
        #
        name = get_device_name(devices[dvc_key]['type'])
        img = get_device_logo(devices[dvc_key]['type'])
        #
        body += urlopen('web/html/html_settings/settings_devices_selection_item.html').read().encode('utf-8').format(name=name,
                                                                                                                img=img,
                                                                                                                grpnum=grpnum,
                                                                                                                dvcnum=dvcnum,
                                                                                                                type=devices[dvc_key]['type'].lower().replace(' ',''))
        count += 1
    #
    body += '</div>'
    #
    return body
Esempio n. 2
0
 def _type_name(self):
     return get_device_name(self._type)