chore: update gitignore

This commit is contained in:
Neil Dorin 2026-05-19 13:42:48 -06:00
parent beb77ec468
commit b459ffbf37
2 changed files with 22 additions and 2 deletions

1
.gitignore vendored
View file

@ -397,3 +397,4 @@ api/
*.DS_Store *.DS_Store
/._PepperDash.Essentials.4Series.sln /._PepperDash.Essentials.4Series.sln
dotnet dotnet
*.lscache

View file

@ -32,17 +32,29 @@ namespace PepperDash.Essentials.AppServer.Messengers
{ {
PostStatusMessage(new PresetStateMessage PostStatusMessage(new PresetStateMessage
{ {
Favorites = _presetsDevice.TvPresets.PresetsList Favorites = _presetsDevice.TvPresets?.PresetsList ?? new List<PresetChannel>()
}, id); }, id);
} }
private void RecallPreset(ISetTopBoxNumericKeypad device, string channel) private void RecallPreset(ISetTopBoxNumericKeypad device, string channel)
{ {
if (_presetsDevice.TvPresets == null)
{
this.LogWarning("TvPresets is null, cannot recall preset");
return;
}
_presetsDevice.TvPresets.Dial(channel, device); _presetsDevice.TvPresets.Dial(channel, device);
} }
private void SavePresets(List<PresetChannel> presets) private void SavePresets(List<PresetChannel> presets)
{ {
if (_presetsDevice.TvPresets == null)
{
this.LogWarning("TvPresets is null, cannot save presets");
return;
}
_presetsDevice.TvPresets.UpdatePresets(presets); _presetsDevice.TvPresets.UpdatePresets(presets);
} }
@ -89,8 +101,15 @@ namespace PepperDash.Essentials.AppServer.Messengers
SavePresets(presets); SavePresets(presets);
}); });
if (_presetsDevice.TvPresets != null)
{
_presetsDevice.TvPresets.PresetsSaved += (p) => SendPresets(); _presetsDevice.TvPresets.PresetsSaved += (p) => SendPresets();
} }
else
{
this.LogWarning("TvPresets is null for {key}, preset saved events will not be tracked", Key);
}
}
#endregion #endregion
} }