Skip to content

Commit

Permalink
wip: add Shades Stop command, map to bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
cdenig committed Sep 14, 2023
1 parent 333efbf commit 5d768f6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions PDT.LutronQuantum.EPI/LutronQuantum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,14 @@ public void ShadeGroupLower(string ShadeGroupId)
SendLine(string.Format("{0}SHADEGRP,{1},{2}", Set, ShadeGroupId, (int)eAction.Lower));
}

/// <summary>
/// Stops the shades in the group
/// </summary>
public void ShadeGroupStop(string ShadeGroupId)
{
SendLine(string.Format("{0}SHADEGRP,{1},{2}", Set, ShadeGroupId, (int)eAction.Stop));
}

public void SetIntegrationId(string id)
{
if (String.IsNullOrEmpty(id))
Expand Down
16 changes: 16 additions & 0 deletions PDT.LutronQuantum.EPI/LutronQuantumBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ public static void LinkToApiExt(this LutronQuantum lightingDevice, BasicTriList
lightingDevice.ShadeGroupLower(lightingDevice.ShadeGroup1Id);
});

trilist.SetSigTrueAction(joinMap.ShadeGroup1Stop, () =>
{
lightingDevice.ShadeGroupStop(lightingDevice.ShadeGroup1Id);
});

trilist.SetSigTrueAction(joinMap.ShadeGroup2Raise, () =>
{
lightingDevice.ShadeGroupRaise(lightingDevice.ShadeGroup2Id);
Expand All @@ -99,6 +104,11 @@ public static void LinkToApiExt(this LutronQuantum lightingDevice, BasicTriList
{
lightingDevice.ShadeGroupLower(lightingDevice.ShadeGroup2Id);
});

trilist.SetSigTrueAction(joinMap.ShadeGroup2Stop, () =>
{
lightingDevice.ShadeGroupStop(lightingDevice.ShadeGroup2Id);
});
}

public class LutronQuantumJoinMap : JoinMapBase
Expand All @@ -114,8 +124,10 @@ public class LutronQuantumJoinMap : JoinMapBase
public uint ShadeGroup2IdSet { get; set; }
public uint ShadeGroup1Raise { get; set; }
public uint ShadeGroup1Lower { get; set; }
public uint ShadeGroup1Stop { get; set; }
public uint ShadeGroup2Raise { get; set; }
public uint ShadeGroup2Lower { get; set; }
public uint ShadeGroup2Stop { get; set; }
public uint Commands { get; set; }

public LutronQuantumJoinMap()
Expand All @@ -131,6 +143,8 @@ public LutronQuantumJoinMap()
ShadeGroup1Lower = 61;
ShadeGroup2Raise = 62;
ShadeGroup2Lower = 63;
ShadeGroup1Stop = 64;
ShadeGroup2Stop = 65;

// Analog

Expand All @@ -152,8 +166,10 @@ public override void OffsetJoinNumbers(uint joinStart)
ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
ShadeGroup1Raise = ShadeGroup1Raise + joinOffset;
ShadeGroup1Lower = ShadeGroup1Lower + joinOffset;
ShadeGroup1Stop = ShadeGroup1Stop + joinOffset;
ShadeGroup2Raise = ShadeGroup2Raise + joinOffset;
ShadeGroup2Lower = ShadeGroup2Lower + joinOffset;
ShadeGroup2Stop = ShadeGroup2Stop + joinOffset;
IntegrationIdSet = IntegrationIdSet + joinOffset;
ShadeGroup1IdSet = ShadeGroup1IdSet + joinOffset;
ShadeGroup2IdSet = ShadeGroup2IdSet + joinOffset;
Expand Down

0 comments on commit 5d768f6

Please sign in to comment.