Skip to content

Commit

Permalink
Added some new properties for Light and Device
Browse files Browse the repository at this point in the history
  • Loading branch information
michielpost committed Jul 8, 2024
1 parent d811aab commit e3d0591
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/HueApi.Tests/HueApi.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.4.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.4.3" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
2 changes: 1 addition & 1 deletion src/HueApi/HueApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
<Version>1.6.2</Version>
<Version>1.6.3</Version>
<Authors>Michiel Post</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Description>For Clip v2 API. Open source library for interaction with the Philips Hue Bridge. Allows you to control your lights from C#.</Description>
Expand Down
23 changes: 23 additions & 0 deletions src/HueApi/Models/Device.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,29 @@ public class Device : HueResource
[JsonPropertyName("product_data")]
public ProductData ProductData { get; set; } = new();

[JsonPropertyName("usertest")]
public UserTest? UserTest { get; set; }

}

public class UserTest
{
[JsonPropertyName("status")]
public string? Status { get; set; }

[JsonPropertyName("usertest")]
public bool UserTestValue { get; set; }
}

public class DeviceMode
{
[JsonPropertyName("status")]
public string? Status { get; set; }

[JsonPropertyName("mode")]
public string? Mode { get; set; }

[JsonPropertyName("mode_values")]
public List<string>? ModeValues { get; set; }
}
}
16 changes: 14 additions & 2 deletions src/HueApi/Models/Light.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class Light : HueResource
public Alert? Alert { get; set; }

[JsonPropertyName("product_data")]
public ProductData? ProductData { get; set; }
public LightProductData? ProductData { get; set; }

[JsonPropertyName("signaling")]
public Signaling? Signaling { get; set; }
Expand All @@ -56,6 +56,18 @@ public class Light : HueResource

}

public class LightProductData
{
[JsonPropertyName("name")]
public string? Name { get; set; }

[JsonPropertyName("archetype")]
public string? ArcheType { get; set; }

[JsonPropertyName("function")]
public string? Function { get; set; }
}

public class Alert
{
[JsonPropertyName("action_values")]
Expand Down Expand Up @@ -298,7 +310,7 @@ public class PowerUp
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum TimedEffect
{
no_effect, sunrise
no_effect, sunrise, sunset
}

[JsonConverter(typeof(JsonStringEnumConverter))]
Expand Down

0 comments on commit e3d0591

Please sign in to comment.