JerrettDavis / MyQDotNet

An unofficial C# wrapper for the MyQ API.
3 stars 0 forks source link

Issue with the Basic Usage Example #1

Closed angry-dad closed 3 years ago

angry-dad commented 3 years ago

Thanks for making this library. I am porting my Python app on my Raspberry Pi into a .NET Core worker service thanks to this library. I ran into issues with the example you have under "Basic Usage". I believe the LINQ statement should be:

var garageDoor = api.Devices.Values.Where(d => d.DeviceFamily == "garagedoor")

api.Values returns the KV pair, which does not have the DeviceFamily property and cannot be cast on the following line. After that change everything worked fine.

JerrettDavis commented 3 years ago

Ah, good catch. It looks like I did overlook that.