From 17980a0b5d478e7f788189cdf05771999f9ccc08 Mon Sep 17 00:00:00 2001 From: "etienne.sdg" Date: Thu, 25 Mar 2021 11:33:38 +0100 Subject: [PATCH] Added state support to SetImageAsync --- src/StreamDeckLib/ConnectionManager.cs | 5 +++-- src/StreamDeckLib/Messages/SetImageArgs.cs | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/StreamDeckLib/ConnectionManager.cs b/src/StreamDeckLib/ConnectionManager.cs index 587fd61..4d55c93 100644 --- a/src/StreamDeckLib/ConnectionManager.cs +++ b/src/StreamDeckLib/ConnectionManager.cs @@ -239,7 +239,7 @@ public async Task SetTitleAsync(string context, string newTitle) await _proxy.SendStreamDeckEvent(args); } - public async Task SetImageAsync(string context, string imageLocation) + public async Task SetImageAsync(string context, string imageLocation, int? state = null) { Debug.WriteLine($"Getting Image from {new FileInfo(imageLocation).FullName} on disk"); @@ -253,7 +253,8 @@ public async Task SetImageAsync(string context, string imageLocation) payload = new SetImageArgs.Payload { TargetType = SetTitleArgs.TargetType.HardwareAndSoftware, - image = $"data:image/{new FileInfo(imageLocation).Extension.ToLowerInvariant().Substring(1)};base64, {imgString}" + image = $"data:image/{new FileInfo(imageLocation).Extension.ToLowerInvariant().Substring(1)};base64, {imgString}", + state = state } }; diff --git a/src/StreamDeckLib/Messages/SetImageArgs.cs b/src/StreamDeckLib/Messages/SetImageArgs.cs index e0ccc77..fce1bae 100644 --- a/src/StreamDeckLib/Messages/SetImageArgs.cs +++ b/src/StreamDeckLib/Messages/SetImageArgs.cs @@ -18,6 +18,8 @@ public class Payload [JsonIgnore] public TargetType TargetType { get; set; } + public int? state { get; set; } + } }