HomeSeer / Plugin-SDK

Plugin development kit for the 4th major edition of the HomeSeer platform.
https://www.nuget.org/packages/HomeSeer-PluginSDK/
GNU Affero General Public License v3.0
21 stars 5 forks source link

StatusGraphicRange - quietly fails to create statusGraphic #211

Open dpmurphy opened 3 years ago

dpmurphy commented 3 years ago

Environment and System Config

Describe the issue Creating an overlapping StatusGraphicRange fails silently

Range 1 96 - 105.9999999 Range 2 105 - 150.9999999 (overlapping)

Steps to Reproduce Steps to reproduce the behavior:

AddStatusGraphicForRange(this, "/images/HomeSeer/status/Thermometer-100.png", 96, 105.9999999);
AddStatusGraphicForRange(this, "/images/HomeSeer/status/Thermometer-110.png", 105, 150.9999999);

Expected behavior The sdk should return a bool (false), or throw an exception or log to console, something to indicate the request (correctly) failed....silent failures should not be allowed.


spudwebb commented 3 years ago

AddStatusGraphicForRange does not exist in the SDK, please provide valid code to reproduce the problem.

dpmurphy commented 3 years ago
                        string img = "/images/HomeSeer/status/Thermometer-100.png"
            ValueRange range = new ValueRange(rangeMin, RangeMax);

            if (feat.HasGraphicForRange(range)) {
                hs.DeleteStatusGraphicByValue(dev.RefId, range.Min);
            }

            var statusGraphic = new StatusGraphic(img, range);
            hs.AddStatusGraphicToFeature(dev.RefId, statusGraphic);
spudwebb commented 3 years ago

Thanks. Tracked as HS-1369