From e3d059128e11ee19a7cac9fd2265bee989ac4271 Mon Sep 17 00:00:00 2001 From: Michiel Post Date: Mon, 8 Jul 2024 10:08:41 +0200 Subject: [PATCH] Added some new properties for Light and Device --- src/HueApi.Tests/HueApi.Tests.csproj | 6 +++--- src/HueApi/HueApi.csproj | 2 +- src/HueApi/Models/Device.cs | 23 +++++++++++++++++++++++ src/HueApi/Models/Light.cs | 16 ++++++++++++++-- 4 files changed, 41 insertions(+), 6 deletions(-) diff --git a/src/HueApi.Tests/HueApi.Tests.csproj b/src/HueApi.Tests/HueApi.Tests.csproj index 8ebf075..50064fd 100644 --- a/src/HueApi.Tests/HueApi.Tests.csproj +++ b/src/HueApi.Tests/HueApi.Tests.csproj @@ -10,9 +10,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/HueApi/HueApi.csproj b/src/HueApi/HueApi.csproj index f55689e..7d84620 100644 --- a/src/HueApi/HueApi.csproj +++ b/src/HueApi/HueApi.csproj @@ -6,7 +6,7 @@ enable enable nullable - 1.6.2 + 1.6.3 Michiel Post MIT For Clip v2 API. Open source library for interaction with the Philips Hue Bridge. Allows you to control your lights from C#. diff --git a/src/HueApi/Models/Device.cs b/src/HueApi/Models/Device.cs index 831f665..ccb19ec 100644 --- a/src/HueApi/Models/Device.cs +++ b/src/HueApi/Models/Device.cs @@ -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? ModeValues { get; set; } + } } diff --git a/src/HueApi/Models/Light.cs b/src/HueApi/Models/Light.cs index a8855ba..47deb69 100644 --- a/src/HueApi/Models/Light.cs +++ b/src/HueApi/Models/Light.cs @@ -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; } @@ -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")] @@ -298,7 +310,7 @@ public class PowerUp [JsonConverter(typeof(JsonStringEnumConverter))] public enum TimedEffect { - no_effect, sunrise + no_effect, sunrise, sunset } [JsonConverter(typeof(JsonStringEnumConverter))]