#set $warning_index = 0
-
#for $region, $region_key in $get_dwd_warnings.items()
#if os.path.exists("dwd/warn-" + $region_key + ".json") and ($warning_index % 2) == 0
-
#set global $region = $region
#set global $region_key = $region_key
#include "includes/dwd-warning.inc"
-
#end if
#set $warning_index = $warning_index + 1
#end for
#set $warning_index = 0
-
#for $region, $region_key in $get_dwd_warnings.items()
#if os.path.exists("dwd/warn-" + $region_key + ".json") and ($warning_index % 2) != 0
-
#set global $region = $region
#set global $region_key = $region_key
#include "includes/dwd-warning.inc"
-
#end if
#set $warning_index = $warning_index + 1
#end for
diff --git a/skins/weewx-wdc/externals.html.tmpl b/skins/weewx-wdc/externals.html.tmpl
index 771a5cce..36650421 100644
--- a/skins/weewx-wdc/externals.html.tmpl
+++ b/skins/weewx-wdc/externals.html.tmpl
@@ -1,4 +1,3 @@
-
#errorCatcher Echo
#encoding UTF-8
@@ -48,11 +47,8 @@
#end if
-
#if 'externals' in $Extras
-
-
#for $external in $Extras['externals']
#if $external == 'description'
#continue
@@ -62,7 +58,6 @@
class="bx--col-sm-4 bx--col-md-8 bx--col-lg-12 bx--col-xlg-6"
style="margin-bottom: 1.25rem"
>
-
#if 'title_long' in $Extras['externals'][$external]
diff --git a/skins/weewx-wdc/includes/icons/wind-direction.inc b/skins/weewx-wdc/includes/icons/wind-direction.inc
index 0f18336c..6a82bef8 100644
--- a/skins/weewx-wdc/includes/icons/wind-direction.inc
+++ b/skins/weewx-wdc/includes/icons/wind-direction.inc
@@ -1,4 +1,3 @@
-
#errorCatcher Echo
#encoding UTF-8
diff --git a/skins/weewx-wdc/month-%Y-%m.html.tmpl b/skins/weewx-wdc/month-%Y-%m.html.tmpl
index 1020095b..44bfa13f 100644
--- a/skins/weewx-wdc/month-%Y-%m.html.tmpl
+++ b/skins/weewx-wdc/month-%Y-%m.html.tmpl
@@ -1,4 +1,3 @@
-
#errorCatcher Echo
#encoding UTF-8
#from time import strftime, localtime
@@ -23,7 +22,6 @@
-
#if $DisplayOptions.get('layout', 'alternative') == 'alternative'
#include 'includes/body-alternative.inc'
#else
diff --git a/skins/weewx-wdc/month.html.tmpl b/skins/weewx-wdc/month.html.tmpl
index 923d498f..a6f7315e 100644
--- a/skins/weewx-wdc/month.html.tmpl
+++ b/skins/weewx-wdc/month.html.tmpl
@@ -1,4 +1,3 @@
-
#errorCatcher Echo
#encoding UTF-8
#from datetime import datetime, timedelta
@@ -24,13 +23,11 @@
-
#if $DisplayOptions.get('layout', 'alternative') == 'alternative'
#include 'includes/body-alternative.inc'
#else
diff --git a/skins/weewx-wdc/offline.html.tmpl b/skins/weewx-wdc/offline.html.tmpl
index 00ae0b04..be97d852 100644
--- a/skins/weewx-wdc/offline.html.tmpl
+++ b/skins/weewx-wdc/offline.html.tmpl
@@ -1,4 +1,3 @@
-
#errorCatcher Echo
#encoding UTF-8
diff --git a/skins/weewx-wdc/sensor-status.html.tmpl b/skins/weewx-wdc/sensor-status.html.tmpl
index de698951..1bb1e895 100644
--- a/skins/weewx-wdc/sensor-status.html.tmpl
+++ b/skins/weewx-wdc/sensor-status.html.tmpl
@@ -1,4 +1,3 @@
-
#errorCatcher Echo
#encoding UTF-8
#from datetime import datetime, timedelta
@@ -16,7 +15,6 @@
#set $sensor_batteries = $to_list($DisplayOptions.get('sensor_battery_status', ['outTempBatteryStatus', 'inTempBatteryStatus', 'rainBatteryStatus', 'windBatteryStatus', 'uvBatteryStatus', 'txBatteryStatus']))
#set $sensor_diagram_period = $DisplayOptions.get('sensor_diagram_period', 'month')
-
#def diagrams($context, $diagrams_config, $diagram_obs)
#set $diagram_index = 0
#if "combined_observations" in $diagrams_config
@@ -61,7 +59,6 @@
#end for
#end def
-
#def get_battery_binary($battery_raw, $battery)
#if $battery_raw == 1
-
#end if
#end def
-
#def get_battery_multi($battery_raw, $battery)
#if $battery_raw <= 1
-
#end if
#end def
-
#def batteries($sensor_batteries, $layout)
-## Some Ecowitt sensors emit a battery state other than 1 or 2 (https://github.com/gjr80/weewx-gw1000/wiki/Sensor-battery-states).
-#set $batteries_multi = ['wh41_ch1_batt', 'wh41_ch2_batt', 'wh41_ch3_batt', 'wh41_ch4_batt', 'wh45_batt', 'wh55_ch1_batt', 'wh55_ch2_batt', 'wh55_ch3_batt', 'wh55_ch4_batt', 'wh57_batt']
-#if $layout == 'alternative'
- #set $classes = "bx--col-sm-4 bx--col-md-8 bx--col-lg-12 bx--col-xlg-6 bx--col-max-4"
-#else
- #set $classes = "bx--col-sm-4 bx--col-md-8 bx--col-lg-12 bx--col-xlg-12 bx--col-max-6"
-#end if
-
-
-
-#for $battery in $sensor_batteries
- #if $getattr($current, $battery).has_data
-
-
- #set $battery_raw = $getVar('current.%s.raw' % $battery)
+ ## Some Ecowitt sensors emit a battery state other than 1 or 2 (https://github.com/gjr80/weewx-gw1000/wiki/Sensor-battery-states).
+ #set $batteries_multi = ['wh41_ch1_batt', 'wh41_ch2_batt', 'wh41_ch3_batt', 'wh41_ch4_batt', 'wh45_batt', 'wh55_ch1_batt', 'wh55_ch2_batt', 'wh55_ch3_batt', 'wh55_ch4_batt', 'wh57_batt']
+ #if $layout == 'alternative'
+ #set $classes = "bx--col-sm-4 bx--col-md-8 bx--col-lg-12 bx--col-xlg-6 bx--col-max-4"
+ #else
+ #set $classes = "bx--col-sm-4 bx--col-md-8 bx--col-lg-12 bx--col-xlg-12 bx--col-max-6"
+ #end if
- #if $battery in $batteries_multi
- $get_battery_multi($battery_raw, $battery)
- #else
- $get_battery_binary($battery_raw, $battery)
+
+ #for $battery in $sensor_batteries
+ #if $getattr($current, $battery).has_data
+
+ #set $battery_raw = $getVar('current.%s.raw' % $battery)
+
+ #if $battery in $batteries_multi
+ $get_battery_multi($battery_raw, $battery)
+ #else
+ $get_battery_binary($battery_raw, $battery)
+ #end if
+
#end if
-
-
-#end if
-#end for
+ #end for
#end def
@@ -176,9 +166,7 @@
-
#if $layout == 'classic'
-
$batteries($sensor_batteries, $layout)
@@ -201,17 +188,14 @@
-
#if 'sensor_table_observations' in $DisplayOptions
-
#set global $table_obs = $DisplayOptions.get('sensor_table_observations')
#include "includes/data-table-tile.inc"
#end if
#else
-
#set global $context = 'day'
@@ -219,7 +203,6 @@
-
#for $obs in $sensor_stat_tile_observations
#set $binding = $get_data_binding($obs)
#set $alltime_tag = $alltime($data_binding=$binding) if $context == 'alltime' else None
@@ -231,27 +214,21 @@
#end for
-
#set global $context = $sensor_diagram_period
-
#include "includes/section-heading.inc"
-
$diagrams($context, $diagrams_config, $sensor_diagram_observations)
-
#if 'sensor_table_observations' in $DisplayOptions
-
#set global $table_obs = $DisplayOptions.get('sensor_table_observations')
#include "includes/data-table-tile.inc"
-
#end if
#end if
diff --git a/skins/weewx-wdc/statistics.html.tmpl b/skins/weewx-wdc/statistics.html.tmpl
index b92569a0..7af6554d 100644
--- a/skins/weewx-wdc/statistics.html.tmpl
+++ b/skins/weewx-wdc/statistics.html.tmpl
@@ -1,4 +1,3 @@
-
#errorCatcher Echo
#encoding UTF-8
#import datetime
@@ -26,9 +25,7 @@