Skip to content

Commit

Permalink
Merge pull request #246 from Mephistofeles/removed-id-datamember
Browse files Browse the repository at this point in the history
Removed DataMember/added JsonIgnore attributes in Id properties in Hue models
  • Loading branch information
michielpost authored Feb 16, 2021
2 parents 289015b + b2e89a0 commit a3589cc
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 16 deletions.
1 change: 0 additions & 1 deletion src/Q42.HueApi/Models/Groups/Group.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ namespace Q42.HueApi.Models.Groups
[DataContract]
public class Group
{
[DataMember]
public string Id { get; set; }

[DataMember(Name = "name")]
Expand Down
1 change: 0 additions & 1 deletion src/Q42.HueApi/Models/Light.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace Q42.HueApi
[DataContract]
public class Light
{
[DataMember(Name = "id")]
public string Id { get; set; }

[DataMember(Name = "state")]
Expand Down
3 changes: 1 addition & 2 deletions src/Q42.HueApi/Models/ResourceLink.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
Expand All @@ -15,7 +15,6 @@ public ResourceLink()
Links = new List<string>();
}

[DataMember]
public string Id { get; set; }

/// <summary>
Expand Down
1 change: 0 additions & 1 deletion src/Q42.HueApi/Models/Scene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace Q42.HueApi.Models
[DataContract]
public class Scene
{
[DataMember]
public string Id { get; set; }

[DataMember(Name = "name")]
Expand Down
1 change: 0 additions & 1 deletion src/Q42.HueApi/Models/Schedule/Schedule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace Q42.HueApi.Models
[DataContract]
public class Schedule
{
[DataMember]
public string Id { get; set; }

[DataMember(Name = "name")]
Expand Down
15 changes: 6 additions & 9 deletions src/Q42.HueApi/Models/Sensors/Sensor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
using Q42.HueApi.Models.Sensors.ZigBee;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Q42.HueApi.Models
{
Expand Down Expand Up @@ -38,7 +35,7 @@ public class Sensor :
[JsonProperty("capabilities")]
public SensorCapabilities Capabilities { get; set; }

[JsonProperty("id")]
[JsonIgnore]
public string Id { get; set; }

[JsonProperty("manufacturername")]
Expand Down Expand Up @@ -197,11 +194,11 @@ public class SensorCapabilities :

public class SensorInput
{
[JsonProperty("repeatintervals")]
public int[] RepeatIntervals { get; set; } = default!;
[JsonProperty("events")]
public SensorEvent[] Events { get; set; } = default!;
[JsonProperty("repeatintervals")]
public int[] RepeatIntervals { get; set; } = default!;

[JsonProperty("events")]
public SensorEvent[] Events { get; set; } = default!;
}

public class SensorEvent
Expand Down
1 change: 0 additions & 1 deletion src/Q42.HueApi/Models/WhiteList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace Q42.HueApi
[DataContract]
public class WhiteList
{
[DataMember(Name = "id")]
public string Id { get; set; }

[DataMember(Name = "last use date")]
Expand Down

0 comments on commit a3589cc

Please sign in to comment.