diff --git a/OmniLinkBridge/Modules/MQTTModule.cs b/OmniLinkBridge/Modules/MQTTModule.cs index cf19395..3500d9e 100644 --- a/OmniLinkBridge/Modules/MQTTModule.cs +++ b/OmniLinkBridge/Modules/MQTTModule.cs @@ -306,7 +306,7 @@ namespace OmniLinkBridge.Modules { log.Debug("Publishing areas"); - for (ushort i = 1; i < OmniLink.Controller.Areas.Count; i++) + for (ushort i = 1; i <= OmniLink.Controller.Areas.Count; i++) { clsArea area = OmniLink.Controller.Areas[i]; @@ -353,7 +353,7 @@ namespace OmniLinkBridge.Modules { log.Debug("Publishing zones"); - for (ushort i = 1; i < OmniLink.Controller.Zones.Count; i++) + for (ushort i = 1; i <= OmniLink.Controller.Zones.Count; i++) { clsZone zone = OmniLink.Controller.Zones[i]; @@ -386,7 +386,7 @@ namespace OmniLinkBridge.Modules { log.Debug("Publishing units"); - for (ushort i = 1; i < OmniLink.Controller.Units.Count; i++) + for (ushort i = 1; i <= OmniLink.Controller.Units.Count; i++) { clsUnit unit = OmniLink.Controller.Units[i]; @@ -412,7 +412,7 @@ namespace OmniLinkBridge.Modules { log.Debug("Publishing thermostats"); - for (ushort i = 1; i < OmniLink.Controller.Thermostats.Count; i++) + for (ushort i = 1; i <= OmniLink.Controller.Thermostats.Count; i++) { clsThermostat thermostat = OmniLink.Controller.Thermostats[i]; @@ -439,7 +439,7 @@ namespace OmniLinkBridge.Modules { log.Debug("Publishing buttons"); - for (ushort i = 1; i < OmniLink.Controller.Buttons.Count; i++) + for (ushort i = 1; i <= OmniLink.Controller.Buttons.Count; i++) { clsButton button = OmniLink.Controller.Buttons[i]; @@ -463,7 +463,7 @@ namespace OmniLinkBridge.Modules // Since the controller doesn't fire zone status change on area status change // request update so armed, tripped, and secure statuses are correct - for (ushort i = 1; i < OmniLink.Controller.Zones.Count; i++) + for (ushort i = 1; i <= OmniLink.Controller.Zones.Count; i++) { clsZone zone = OmniLink.Controller.Zones[i]; diff --git a/OmniLinkBridge/WebService/OmniLinkService.cs b/OmniLinkBridge/WebService/OmniLinkService.cs index 015c74c..a007806 100644 --- a/OmniLinkBridge/WebService/OmniLinkService.cs +++ b/OmniLinkBridge/WebService/OmniLinkService.cs @@ -25,7 +25,7 @@ namespace OmniLinkBridge.WebAPI log.Debug("ListAreas"); List names = new List(); - for (ushort i = 1; i < WebServiceModule.OmniLink.Controller.Areas.Count; i++) + for (ushort i = 1; i <= WebServiceModule.OmniLink.Controller.Areas.Count; i++) { clsArea area = WebServiceModule.OmniLink.Controller.Areas[i]; @@ -52,7 +52,7 @@ namespace OmniLinkBridge.WebAPI log.Debug("ListZonesContact"); List names = new List(); - for (ushort i = 1; i < WebServiceModule.OmniLink.Controller.Zones.Count; i++) + for (ushort i = 1; i <= WebServiceModule.OmniLink.Controller.Zones.Count; i++) { clsZone zone = WebServiceModule.OmniLink.Controller.Zones[i]; @@ -67,7 +67,7 @@ namespace OmniLinkBridge.WebAPI log.Debug("ListZonesMotion"); List names = new List(); - for (ushort i = 1; i < WebServiceModule.OmniLink.Controller.Zones.Count; i++) + for (ushort i = 1; i <= WebServiceModule.OmniLink.Controller.Zones.Count; i++) { clsZone zone = WebServiceModule.OmniLink.Controller.Zones[i]; @@ -82,7 +82,7 @@ namespace OmniLinkBridge.WebAPI log.Debug("ListZonesWater"); List names = new List(); - for (ushort i = 1; i < WebServiceModule.OmniLink.Controller.Zones.Count; i++) + for (ushort i = 1; i <= WebServiceModule.OmniLink.Controller.Zones.Count; i++) { clsZone zone = WebServiceModule.OmniLink.Controller.Zones[i]; @@ -97,7 +97,7 @@ namespace OmniLinkBridge.WebAPI log.Debug("ListZonesSmoke"); List names = new List(); - for (ushort i = 1; i < WebServiceModule.OmniLink.Controller.Zones.Count; i++) + for (ushort i = 1; i <= WebServiceModule.OmniLink.Controller.Zones.Count; i++) { clsZone zone = WebServiceModule.OmniLink.Controller.Zones[i]; @@ -112,7 +112,7 @@ namespace OmniLinkBridge.WebAPI log.Debug("ListZonesCO"); List names = new List(); - for (ushort i = 1; i < WebServiceModule.OmniLink.Controller.Zones.Count; i++) + for (ushort i = 1; i <= WebServiceModule.OmniLink.Controller.Zones.Count; i++) { clsZone zone = WebServiceModule.OmniLink.Controller.Zones[i]; @@ -127,7 +127,7 @@ namespace OmniLinkBridge.WebAPI log.Debug("ListZonesTemp"); List names = new List(); - for (ushort i = 1; i < WebServiceModule.OmniLink.Controller.Zones.Count; i++) + for (ushort i = 1; i <= WebServiceModule.OmniLink.Controller.Zones.Count; i++) { clsZone zone = WebServiceModule.OmniLink.Controller.Zones[i]; @@ -161,7 +161,7 @@ namespace OmniLinkBridge.WebAPI log.Debug("ListUnits"); List names = new List(); - for (ushort i = 1; i < WebServiceModule.OmniLink.Controller.Units.Count; i++) + for (ushort i = 1; i <= WebServiceModule.OmniLink.Controller.Units.Count; i++) { clsUnit unit = WebServiceModule.OmniLink.Controller.Units[i]; @@ -205,7 +205,7 @@ namespace OmniLinkBridge.WebAPI log.Debug("ListThermostats"); List names = new List(); - for (ushort i = 1; i < WebServiceModule.OmniLink.Controller.Thermostats.Count; i++) + for (ushort i = 1; i <= WebServiceModule.OmniLink.Controller.Thermostats.Count; i++) { clsThermostat unit = WebServiceModule.OmniLink.Controller.Thermostats[i]; @@ -278,7 +278,7 @@ namespace OmniLinkBridge.WebAPI log.Debug("ListButtons"); List names = new List(); - for (ushort i = 1; i < WebServiceModule.OmniLink.Controller.Buttons.Count; i++) + for (ushort i = 1; i <= WebServiceModule.OmniLink.Controller.Buttons.Count; i++) { clsButton unit = WebServiceModule.OmniLink.Controller.Buttons[i];