Skip to content

Commit

Permalink
Merge pull request #59 from GamerClassN7/dev
Browse files Browse the repository at this point in the history
Runtime Bug Fixes Stability Improvements
  • Loading branch information
GamerClassN7 authored Aug 8, 2023
2 parents 2c73651 + 2244f90 commit 2fb62c7
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 137 deletions.
3 changes: 2 additions & 1 deletion HA/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
using System.Net.NetworkInformation;
using System.Security.Policy;
using AutoUpdaterDotNET;
using System.Diagnostics.Tracing;

namespace HA
{
Expand Down Expand Up @@ -724,7 +725,7 @@ private void Application_DispatcherUnhandledException(object sender, DispatcherU

private void UnhandeledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
MessageBox.Show("An unhandled exception just occurred: " + e.Exception.Message, "Exception Sample", MessageBoxButton.OK, MessageBoxImage.Error);
Logger.write("[" + AppDomain.CurrentDomain.FriendlyName + "]" + e.Exception.Message.ToString(), 3);
e.Handled = true;
}
}
Expand Down
7 changes: 2 additions & 5 deletions HA/Class/HomeAssistant/HomeAssistantWS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ public HomeAssistantWS(string apiUrl, string webhookId, string apiToken)
retryCount++;
registerAsync();
} catch (Exception ex) {
isSubscribed = false;
isPingEnabled = false;
isConnected = false;


throw new Exception("unnable to connect to" + url);
}
Expand Down Expand Up @@ -122,12 +120,11 @@ public async Task registerAsync()
Logger.write("WS URL " + url);

Close();

if (retryCount <= 5)
{
retryCount++;
registerAsync();
}
}
}
}

Expand Down
13 changes: 4 additions & 9 deletions HA/HA.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,19 @@
<UseWindowsForms>true</UseWindowsForms>
<PackageIcon>ha_logo.ico</PackageIcon>
<ApplicationIcon>ha_logo.ico</ApplicationIcon>
<AssemblyVersion>0.0.9.0</AssemblyVersion>
<AssemblyVersion>0.0.9.5</AssemblyVersion>
</PropertyGroup>
<ItemGroup>
<None Remove="configuration.yaml" />
<None Remove="Resources\configuration.yaml" />
<None Remove="Resources\ha_loading.gif" />
<None Remove="Resources\ha_logo.png" />
</ItemGroup>
<ItemGroup>
<Content Include="configuration.yaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Autoupdater.NET.Official" Version="1.8.3" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Management" Version="7.0.2" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\configuration.yaml" />
<Resource Include="Resources\ha_loading.gif" />
<Resource Include="Resources\ha_logo.png" />
</ItemGroup>
Expand All @@ -49,6 +41,9 @@
<None Update="App.config">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Update="configuration.yaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="ha_logo.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
2 changes: 1 addition & 1 deletion HA/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public MainWindow()

static void GlobalExceptionFunction(object source, FirstChanceExceptionEventArgs eventArgs)
{
Logger.write("[" + AppDomain.CurrentDomain.FriendlyName + "]" + eventArgs.Exception.ToString(), 1);
Logger.write("[" + AppDomain.CurrentDomain.FriendlyName + "]" + eventArgs.Exception.ToString(), 3);
}

private void Save_Click(object sender, RoutedEventArgs e)
Expand Down
10 changes: 0 additions & 10 deletions HA/Resource.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions HA/Resource.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,10 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="configuration" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\configuration.yaml;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="ha_loading" xml:space="preserve">
<value />
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="ha_loading1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\ha_loading.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand Down
106 changes: 0 additions & 106 deletions HA/Resources/configuration.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion HA/meta.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>0.0.9.0</version>
<version>0.0.9.5</version>
<url>https://github.com/GamerClassN7/HA_Desktop_Companion/releases/latest/download/HA_Self_Contained.zip</url>
<changelog>https://github.com/GamerClassN7/HA_Desktop_Companion/releases/latest</changelog>
<mandatory>false</mandatory>
Expand Down

0 comments on commit 2fb62c7

Please sign in to comment.