jlynch630 / Harmony.NET

Logitech Harmony control in .NET
MIT License
28 stars 13 forks source link

Hub.State always null #10

Closed bluewalk closed 5 years ago

bluewalk commented 5 years ago

Hub.State is always null, even after calling hub.SyncConfigurationAsync();. Hitting this when calling hub.GetRunningActivity().

Background: simple console app to get the running activity and when my I switch my domotics to Night-Mode it should return the status and if different than -1 (Off) it should activate the -1 activity. Is it because the console app is not open for a long enough time to receive the connect.statedigest?get or connect.statedigest?notify commands?

jlynch630 commented 5 years ago

Yeah I implemented this mostly halfway last night. There is a method like GetStateAsync you can call which is separate from SyncConfigurationAsync

On Wed, Dec 19, 2018, 10:13 AM Délano <notifications@github.com wrote:

Hub.State is always null, even after calling hub.SyncConfigurationAsync();. Hitting this when calling hub.GetRunningActivity().

Background: simple console app to get the running activity and when my I switch my domotics to Night-Mode it should return the status and if different than -1 (Off) it should activate the -1 activity. Is it because the console app is not open for a long enough time to receive the connect.statedigest?get or connect.statedigest?notify commands?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jlynch630/Harmony.NET/issues/10, or mute the thread https://github.com/notifications/unsubscribe-auth/AB39CIDeB61Zj_ul2D2wmWfDSAfm3H5tks5u6oG4gaJpZM4Zaww1 .

bluewalk commented 5 years ago

A brilliant, had to change

public Dictionary<string, string> Updates { get; set; }

to

public List<Dictionary<string, string>> Updates { get; set; }

in StateDigest to get it do deserialize though.

jlynch630 commented 5 years ago

Interesting. Wonder why it didn't throw

On Wed, Dec 19, 2018, 10:22 AM Délano <notifications@github.com wrote:

A brilliant, had to change

public Dictionary<string, string> Updates { get; set; }

to

public List<Dictionary<string, string>> Updates { get; set; }

in StateDigest to get it do deserialize though.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jlynch630/Harmony.NET/issues/10#issuecomment-448695339, or mute the thread https://github.com/notifications/unsubscribe-auth/AB39CDc3lpOAjMEoO3g_e3E6h25e6nW7ks5u6oPNgaJpZM4Zaww1 .