Skip to content

Commit

Permalink
fix: Don't hide cards when no metric data is available
Browse files Browse the repository at this point in the history
  • Loading branch information
bourquep committed Nov 2, 2024
1 parent 526f958 commit 1087736
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion weewx/skins/me.teo/data/current.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
##
#set $observations = $to_list($DisplayOptions.get('observations_current', ['outTemp', 'outHumidity', 'windDir', 'windSpeed', 'windGust', 'rainRate', 'rain', 'lightning_strike_count', 'barometer', 'UV']))
#set $observations = $to_list($DisplayOptions.get('observations_current', ['outTemp', 'outHumidity', 'windDir', 'windSpeed', 'windGust', 'rainRate', 'rain', 'barometer', 'UV']))
#set $obs_type_sum = $to_list($DisplayOptions.get('obs_type_sum', ['rain', 'ET', 'hail', 'snow', 'lightning_strike_count']))
#set $obs_type_max = $to_list($DisplayOptions.get('obs_type_max', ['rainRate', 'hailRate', 'snowRate', 'UV']))
{
Expand Down Expand Up @@ -49,6 +49,14 @@
"past24h": $getattr($span(hour_delta=24), $x).series(aggregate_type='avg', aggregate_interval='1h', time_series='start').json
#end if
},
#else
{
"observation": "$x",
"label": "$obs.label[$x]",
"unit": "$getVar('unit.label.' + $x)",
"current": 0,
"past24h": []
},
#end if
#end for
## Last value can't end with a comma
Expand Down

0 comments on commit 1087736

Please sign in to comment.