Skip to content
This repository has been archived by the owner on Jul 18, 2020. It is now read-only.

Commit

Permalink
Added groupstate.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyrules committed Feb 2, 2017
1 parent c5224f7 commit 42a6d83
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
1 change: 1 addition & 0 deletions HueLib2/HueLib2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
<Compile Include="Communication\Communication.cs" />
<Compile Include="Objects\Group\Action.cs" />
<Compile Include="Objects\Group\Group.cs" />
<Compile Include="Objects\Group\GroupState.cs" />
<Compile Include="Objects\HueObject\HueObject.cs" />
<Compile Include="Objects\ItemSource\AlertItemsSource.cs" />
<Compile Include="Objects\ItemSource\EffectItemsSource.cs" />
Expand Down
6 changes: 0 additions & 6 deletions HueLib2/Objects/Group/Action.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ public Action()

}

[DataMember(EmitDefaultValue = false, IsRequired = false), Description("Identify if all lights are on."), Category("Action Properties"), Browsable(false), ReadOnly(true)]
public bool? all_on { get; set; }

[DataMember(EmitDefaultValue = false, IsRequired = false), Description("Identify if any lights are on."), Category("Action Properties"), Browsable(false), ReadOnly(true)]
public bool? any_on { get; set; }

/// <summary>
/// Scene to recall
/// </summary>
Expand Down
4 changes: 4 additions & 0 deletions HueLib2/Objects/Group/Group.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Globalization;
using System.Runtime.Serialization;
using System.Windows.Markup;
using HueLib2.Objects.Group;
using Newtonsoft.Json;
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;

Expand All @@ -23,6 +24,9 @@ public class Group : HueObject
/// </summary>
[DataMember, Category("Action"), Description("Action"),ExpandableObject, ReadOnly(true)]
public Action action { get; set; }

[DataMember, Category("State"), Description("State"),ExpandableObject, ReadOnly(true)]
public GroupState state { get; set; }
/// <summary>
/// List of lights in the group.
/// </summary>
Expand Down
27 changes: 27 additions & 0 deletions HueLib2/Objects/Group/GroupState.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace HueLib2.Objects.Group
{
public class GroupState
{

[DataMember(EmitDefaultValue = false, IsRequired = false), Description("Identify if all lights are on."), Category("Action Properties"), ReadOnly(true)]
public bool? all_on { get; set; }

[DataMember(EmitDefaultValue = false, IsRequired = false), Description("Identify if any lights are on."), Category("Action Properties"), ReadOnly(true)]
public bool? any_on { get; set; }

public override string ToString()
{
return JsonConvert.SerializeObject(this,
new JsonSerializerSettings() {NullValueHandling = NullValueHandling.Ignore});
}
}
}

0 comments on commit 42a6d83

Please sign in to comment.