mirror of
https://github.com/excaliburpartners/OmniLinkBridge
synced 2025-05-07 01:13:12 +00:00
- Request zone status update on area status change
This commit is contained in:
parent
fdaa26830e
commit
e44d628886
|
@ -394,6 +394,31 @@ namespace OmniLinkBridge.Modules
|
|||
private void Omnilink_OnAreaStatus(object sender, AreaStatusEventArgs e)
|
||||
{
|
||||
PublishAreaState(e.Area);
|
||||
|
||||
// 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++)
|
||||
{
|
||||
clsZone zone = OmniLink.Controller.Zones[i];
|
||||
|
||||
if (zone.DefaultProperties == false && zone.Area == e.Area.Number)
|
||||
OmniLink.Controller.Connection.Send(new clsOL2MsgRequestExtendedStatus(OmniLink.Controller.Connection, enuObjectType.Zone, i, i), HandleRequestZoneStatus);
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleRequestZoneStatus(clsOmniLinkMessageQueueItem M, byte[] B, bool Timeout)
|
||||
{
|
||||
if (Timeout)
|
||||
return;
|
||||
|
||||
clsOL2MsgExtendedStatus MSG = new clsOL2MsgExtendedStatus(OmniLink.Controller.Connection, B);
|
||||
|
||||
for (byte i = 0; i < MSG.ZoneStatusCount(); i++)
|
||||
{
|
||||
clsZone zone = OmniLink.Controller.Zones[MSG.ObjectNumber(i)];
|
||||
zone.CopyExtendedStatus(MSG, i);
|
||||
MqttClient.PublishAsync(zone.ToTopic(Topic.state), zone.ToState(), MqttQualityOfServiceLevel.AtMostOnce, true);
|
||||
}
|
||||
}
|
||||
|
||||
private void Omnilink_OnZoneStatus(object sender, ZoneStatusEventArgs e)
|
||||
|
|
|
@ -391,7 +391,7 @@ namespace OmniLinkBridge.Modules
|
|||
case enuObjectType.Zone:
|
||||
Controller.Zones.CopyProperties(MSG);
|
||||
|
||||
if (Controller.Zones[MSG.ObjectNumber].IsTemperatureZone())
|
||||
if (Controller.Zones[MSG.ObjectNumber].IsTemperatureZone() || Controller.Zones[MSG.ObjectNumber].IsHumidityZone())
|
||||
Controller.Connection.Send(new clsOL2MsgRequestExtendedStatus(Controller.Connection, enuObjectType.Auxillary, MSG.ObjectNumber, MSG.ObjectNumber), HandleRequestAuxillaryStatus);
|
||||
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue