From 744095aa4676553437db0d71c281a74557a3222f Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sun, 18 Nov 2018 16:12:36 +0100 Subject: 2018-11-18 14:16:00 --- tex/context/base/mkiv/util-evo.lua | 48 +++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 21 deletions(-) (limited to 'tex/context/base/mkiv/util-evo.lua') diff --git a/tex/context/base/mkiv/util-evo.lua b/tex/context/base/mkiv/util-evo.lua index 19c394c79..e77b7963a 100644 --- a/tex/context/base/mkiv/util-evo.lua +++ b/tex/context/base/mkiv/util-evo.lua @@ -535,27 +535,29 @@ local function gettemperatures(presets) for i=1,#data do local gateways = data[i].gateways local locationinfo = data[i].locationInfo - local locationid = locationinfo.locationId - if gateways then - local status = getstatus(presets,locationid,locationinfo.name) - if status then - for i=1,#gateways do - local g = status.gateways[i] - local gateway = gateways[i] - local systems = gateway.temperatureControlSystems - if systems then - local s = g.temperatureControlSystems - for i=1,#systems do - local zones = systems[i].zones - if zones then - local z = s[i].zones - for i=1,#zones do - local zone = zones[i] - if validzonetypes[zone.zoneType] then - local z = z[i] - if z.name == zone.name then - zone.temperatureStatus = z.temperatureStatus - updated = true + if locationinfo then + local locationid = locationinfo.locationId + if gateways then + local status = getstatus(presets,locationid,locationinfo.name) + if status then + for i=1,#gateways do + local g = status.gateways[i] + local gateway = gateways[i] + local systems = gateway.temperatureControlSystems + if systems then + local s = g.temperatureControlSystems + for i=1,#systems do + local zones = systems[i].zones + if zones then + local z = s[i].zones + for i=1,#zones do + local zone = zones[i] + if validzonetypes[zone.zoneType] then + local z = z[i] + if z.name == zone.name then + zone.temperatureStatus = z.temperatureStatus + updated = true + end end end end @@ -563,7 +565,11 @@ local function gettemperatures(presets) end end end + else + report("no gateways") end + else + report("no location info") end end if updated then -- cgit v1.2.3