$def with (statusCode) $var title: $_(u'Update sensors firmware') $var page: sensors_firmware $code: def _version(s): if int(s) > 0: res = [int(x) for x in str(s)] return "{}.{}{}".format(res[0], res[1], res[2]) else: return "-.--"
$_(u'Update sensors firmware')

$_(u'Actual available firmware version for ESP32 sensors') $if version.ver_esp32 != "-": $_(u'FW:')${version.ver_esp32} $_('Open dir') $else: $_('Not available')

$_(u'Actual available firmware version for ESP8266 sensors') $if version.ver_esp8266 != "-": $_(u'FW:')${version.ver_esp8266} $_('Open dir') $else: $_('Not available')


$_('These sensors are already assigned.') $_('"AP button" is used for starting AP manager in sensor without physical access to sensor.')

$for sensor in sensors.get(): $if int(sensor.cpu_core) == 0 and version.ver_esp32 != "-": $if int(sensor.cpu_core) == 1 and version.ver_esp8266 != "-":
$_(u'Sensor Name') $_(u'Sensor CPU') $_(u'Sensor IP Address') $_(u'MAC Address') $_(u'Used Version') $_(u'State') $_(u'Run AP')
${sensor.name} $if int(sensor.cpu_core) == 0: $_(u'ESP32') $elif int(sensor.cpu_core) == 1: $_(u'ESP8266') $else: $_('Not available') ${sensor.ip_address[0] +'.'+ sensor.ip_address[1]+'.'+ sensor.ip_address[2]+'.'+ sensor.ip_address[3]} ${sensor.mac_address} $_version(sensor.fw) $if _version(sensor.fw) == version.ver_esp32: $_('Actual') $elif _version(sensor.fw) > version.ver_esp32: $_('Sensor has a newer version') $else: $_('Update to FW:')${version.ver_esp32} $if _version(sensor.fw) == version.ver_esp8266: $_('Actual') $elif _version(sensor.fw) > version.ver_esp8266: $_('Sensor has a newer version') $else: $_('Update to FW:')${version.ver_esp8266} $_('AP')
$_(u'Custom manualy firmware upgrade')

$_('Select the file for the sensor, the IP address and the port of the sensor. This option is used to upload your own firmware to the sensor without of the selection from OSPy versions.')

$_('Example data line: "http(s)://ip:port/password".')

$_('Protocol') $_('IP address') $_('Port') $_('Password') $_('Upload to sensor')
$_('Back to Sensors') $_('Refresh') $_(u'Searching Sensors')