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
20 stars 4 forks source link

DisplayedStatus does not match the string shown on the website #346

Open avargaskun opened 1 year ago

avargaskun commented 1 year ago

Environment

HomeSeer

OS

Both

HS Version

v4.2.17.0

Development

PSDK Version

v1.4.3.0

Language

C#

IDE

VSCode

Dev OS

Mac

Page

Devices

Plugin

AKWeather, HSBuddy

Problem

Description

Getting the DisplayedString property of a device does not return the same string that is shown in the website, instead it returns the string from the Status/Graphic pairs. The plug-in that created the device (AKWeather in this case) added a Status/Graphic for -2147482651 with a string of Error. However, at some point the string value of the device is set to a string, in this case: Winter Weather Advisory.

The devices page in the website properly shows Winter Weather Advisory. However, when I read the device from another plug-in using the HS SDK (HSBuddy in this case), the device DisplayedStatus returns the Status/Graphic value of Error. The StatusString returns the proper string value.

Screenshots

DeviceView

DeviceStatus

DeviceValue

Expected Behavior

According to the SDK documentation, DisplayedStatus should return: "This is the exact string that users see in the UI".

⭐ Why is it DisplayedStatus not returning the same value showed in the UI? ❓

Steps to Reproduce

See screenshots

Logs

N/A

spudwebb commented 1 year ago

I can reproduce the problem if I retrieve a feature using HsFeature feat = HomeSeerSystem.GetFeatureByRef(2103); and then look at feat.DisplayedStatus

However getting the property directly using string displayedStatus = (string) HomeSeerSystem.GetPropertyByRef(2103, EProperty.DisplayedStatus); works as expected

Can you confirm retrieving the displayed status using GetPropertyByRef works as expected for you as well?

avargaskun commented 1 year ago

I can confirm that IHsController.GetPropertyByRef returns the same string as what is displayed in the website. I can use that as a workaround for now. I can leave this issue open to track the fix for AbstractHsDevice.

spudwebb commented 1 year ago

Thanks for confirming Tracked as HS-1818