Replies: 2 comments 4 replies
-
I've never used that binding and I took a quick look at the code. Shouldn't you check the |
Beta Was this translation helpful? Give feedback.
-
That binding is coming from IoT Core. I'm referring this to mention that I'm not aware of design discussions that happen at the time. I would go for a rewrite, as you've suggested. Basically, simplifying it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Using Am2320.cs
When the read fails, the sensor class returns default (Temperature) default (Humidity) classes. The default classes cannot be differentiated from valid classes (different defect / suggestion posted in that library), so when the code accessed any of the class accessors, it throws a general type conversion exception. The core problem is a fix for the actual Temperature and humidity objects to not throw exceptions, but one hacky solution could be properties like HumidityError or TemperatureError or similar that return internal static values for comparison purposes e.g. if temperature is sensor.TemperatureError or humidity is sensor.HumidityError . Don't love either proposal but this is more related to the case where the values are read early in a process and then passed around, but you can't detect a failed read. that happened way earlier.
Beta Was this translation helpful? Give feedback.
All reactions