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

Device card in devices.html does not display feature even when it exists. #322

Open hem-bhagat-tark opened 1 year ago

hem-bhagat-tark commented 1 year ago

Environment

HomeSeer

OS

Windows

HS Version

v4.2.16.0

Development

PSDK Version

v1.4.2.0

Language

C#

IDE

VS2022

Dev OS

Windows

Page

devices.html

Problem

Description

The card for the device on the devices.html page does not display features even when they are available. This happens when I programmatically delete some of the features of the device I have created using the plugin. In debug mode if I fetch the device using HomeSeerSystem I can see the feature there but not on the card. To better understand the problem consider the following scenario.

I have a config.html page registered with my plugin which lists the different number of features a device can have when created using the plugin. Users can enable/disable features as per their requirements. Apart from affecting the new devices created using the plugin (i.e. the new device created should have features as configured by the user on the config.html page) I want to add/delete the features in the existing devices when a user enables/disables the features in the config.html page. So, if the user disables two features in the config.html page and the existing devices have three features, the respective two features should be deleted in all the existing devices and all of them should have one feature which is enabled in the config.html page. This is where I am facing the problem. When I disable two features, the logic correctly deletes the respective two features (I have confirmed this multiple times by debugging using different scenarios) and the device card should show one feature. But the card does not show any feature as if all the features are deleted. As I mentioned in the description, I am able to get the remaining feature in the device.Features list fetched using HomeSeerSystem. So, it is there but just not being displayed on the card. Also not able to see the feature if we go to the Features tab for that device.

Important Note: I am not facing this issue every time. It happens occasionally. As per my observation, it happens when I try to delete multiple features on multiple devices. It will sometime reproduce sometimes not.

Screenshots

Screenshot 1: Device card on the devices.html page image

Screenshot 2: Pop-up when clicked on a device card on the devices.html page image

Screenshot 3: Feature tab for a device image

Screenshot 4: Watch window in debug mode showing that the device has the feature. image

Expected Behavior

The UI should display the features.

Steps to Reproduce

I have explained my scenario in the description part. To reproduce this you can create a sample as per the scenario I have mentioned.

Logs

Not Applicable

spudwebb commented 1 year ago

when it happens, does a restart of HS4 fix the problem?

hem-bhagat-tark commented 1 year ago

I didn't try the restart and also currently I don't have the code handy which produced this issue.