Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/testing updates #13

Merged
merged 2 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions src/SonyBraviaInputs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@
using PepperDash.Core;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
using PepperDash.Essentials.Core.Queues;
using SonyBraviaEpi;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SonyBraviaEpi
{
#if SERIES4
public class SonyBraviaInputs : ISelectableItems<string>
{
private Dictionary<string, ISelectableItem> _items = new Dictionary<string, ISelectableItem>();
Expand Down Expand Up @@ -61,10 +56,10 @@ public class SonyBraviaInput : ISelectableItem
{
private bool _isSelected;

private readonly byte[] _command;
private readonly byte[] _command;

private readonly IQueueMessage _inputCommand;
private readonly SonyBraviaDevice _parent;
private readonly SonyBraviaDevice _parent;

public SonyBraviaInput(string key, string name, SonyBraviaDevice parent, IQueueMessage inputCommand)
{
Expand All @@ -77,7 +72,7 @@ public SonyBraviaInput(string key, string name, SonyBraviaDevice parent, IQueueM
public SonyBraviaInput(string key, string name, SonyBraviaDevice parent, byte[] command)
{
Key = key;
Name = name;
Name = name;
_command = command;
_parent = parent;
}
Expand All @@ -104,17 +99,16 @@ public bool IsSelected

public void Select()
{
if(_parent.ComsIsRs232)
if (_parent.ComsIsRs232)
{
Debug.LogMessage(Serilog.Events.LogEventLevel.Information, "Sending input command for {name}: {command}",this, Name, ComTextHelper.GetEscapedText(_command));
Debug.LogMessage(Serilog.Events.LogEventLevel.Information, "Sending input command for {name}: {command}", this, Name, ComTextHelper.GetEscapedText(_command));

_parent.SendRs232Command(_command);

_parent.SendRs232Command(_command);

return;
}

_parent.EnqueueCommand(_inputCommand);
}
}
#endif
}
4 changes: 4 additions & 0 deletions src/epi-sony-bravia.4Series.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
<DefineConstants>$(DefineConstants);SERIES4</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DefineConstants>$(DefineConstants);SERIES4</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Properties\**" />
<EmbeddedResource Remove="Properties\**" />
Expand Down
Loading