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

Displaying multiple features values in Grid View #270

Closed alexbk66 closed 2 years ago

alexbk66 commented 2 years ago

If my device has 2-4 temperature readings (features) - can I show them in the Grid View?

rjhelmke commented 2 years ago

I assume this is for a thermostat device? Thermostat device types use different HTML to generate the grid view and it uses the device types as set in the feature. I think right now we only have one device type for the temperature. The 2 options are I see are to add more device types for more temps or a better option might be to allow the developer to specify their own HTML for the grid view.

alexbk66 commented 2 years ago

No, it's for new AKWebIO plugin - temperature monitoring devices (2 - 4 channels)

rjhelmke commented 2 years ago

Can you put each temp in it's own feature? The grid can display up to 5 features (status). You can assign these as important so they all display by default in the grid.

alexbk66 commented 2 years ago

They obviously are in it's own feature. How do I assign these as important?

alexbk66 commented 2 years ago

Ok, worked it out, thank you

image

alexbk66 commented 2 years ago

One question though, how do I control the display order? Setting "EProperty.FeatureDisplayPriority" doesn't seem to work.

HsDevice.FeatureDisplayPriority comment says "This should typically be left to the user to configure" - that's great, but how/where can user configure the FeatureDisplayPriority?

image

I.e. I want the buttons to be at the bottom, so the CTRL device (with thee buttons) should have Priority 3 - see the "mock-up":

image

spudwebb commented 2 years ago

Edit the root device, then go to the features tab, from there you can change the display type and the priority order using the arrows or drag and dropping. Note that you are supposed to be able to set the priority from the SDK too. image

alexbk66 commented 2 years ago

Thank you @spudwebb, I didn't see this.

As I said, setting the priority from code didn't seem to work, I use hs.UpdatePropertyByRef(EProperty.FeatureDisplayPriority) - do I need to call some other Update function after that?

spudwebb commented 2 years ago

What parameter are you passing to UpdatePropertyByRef ? Does it throws an exception?

I just tested with the following code line and it worked: HomeSeerSystem.UpdatePropertyByRef(999, EProperty.FeatureDisplayPriority, new List<int>() { 1000, 1001 });

where 999 is the ref of the parent device, and 1000 and 1001 are the ref of the 2 child features.

alexbk66 commented 2 years ago

Ah, no, I just pass priority int - it's unclear what to pass, especially because the name is singular. Hmm, so if I want to set the feature priority - I can't do it inside the feature class itself. I need to do it in the root (parent)... And I need to know the complete list of children and the priority of each child. Really inconvenient...

alexbk66 commented 2 years ago

Really inconvenient. Because if I add another child later - I need to re-arrange the whole list ;(