Manual or Automatic Device Creation

Posted on
Sun Apr 26, 2020 10:00 am
neilk offline
Posts: 715
Joined: Jul 13, 2015
Location: Reading, UK

Manual or Automatic Device Creation

Hi all,
In one of the plugins I am working on it only makes sense for a single device instance to exist, and it can be configured using the plugin configuration. I am tempted (to increase my knowledge) to have the plugin automatically generate the device, but before I do that what would you describe as best practice , letting the user create a device with zero config but with a name and folder location of their choice, or automate the creation ? The device will show the current electricity rate for the property postcode.
Thanks,
Neil

Posted on
Sun Apr 26, 2020 11:03 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Manual or Automatic Device Creation

I always use plugin creation when possible for devices and variables.

But most of my devices have many parameters and it is easier to just create them properly instead of asking the user to set everything right.

The issue though is that the user still can duplicate the device or delete it manually.

That would be a nice feature to have : devices that can not be changed / created/ duplicated by the user, or only when the plugin is not running.

Karl

Posted on
Sun Apr 26, 2020 11:20 am
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Manual or Automatic Device Creation

neilk wrote:
In one of the plugins I am working on it only makes sense for a single device instance to exist, and it can be configured using the plugin configuration. I am tempted (to increase my knowledge) to have the plugin automatically generate the device, but before I do that what would you describe as best practice , letting the user create a device with zero config but with a name and folder location of their choice, or automate the creation ? The device will show the current electricity rate for the property postcode.


In your case, I would have the user create the device and provide the post code at device creation time. There's no reason to limit the user to only one property in a single post codes, you should allow for multiple devices.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Apr 26, 2020 1:17 pm
neilk offline
Posts: 715
Joined: Jul 13, 2015
Location: Reading, UK

Re: Manual or Automatic Device Creation

Thanks both, and Joe - I will implement as you suggest, you stop me going down a route of adding more complexity for less flexibility.



Neil

Posted on
Mon Apr 27, 2020 9:04 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Manual or Automatic Device Creation

As a general rule, you shouldn't automatically create devices. An exception is when a user adds a device that creates multiple linked devices (like a multisensor or the Airfoil instance that creates the linked speaker devices). Having the user in control of when and where devices are created has always been how Indigo works and we believe it should continue to be the standard approach. If discovery is possible, then a great user experience is to show the user a list of potential devices in the device create dialog so they just pick from a list of available devices (i.e. the Z-Wave plugin).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests

cron