-
-
Notifications
You must be signed in to change notification settings - Fork 633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Improve device configuration format #1675
Comments
The manufacturer one wouldn't work as described because the manufactuerid is still not per device. There are no cases to my knowledge where the same devices within a manufacturer have duplicate files. That's what usually changes and not just the text label. (For example, Honeywell and GE devices are both made by Jasco.) If we moved it into the device tree then we'd need to figure out in which folder the file should live. |
Reg. the same-device-different-manufacturer thing. How about a json reference? Example: {
// Either a custom identifier of sorts, that you can parse into a path
"$ref": "0x0103 ses_fs-zw",
// .. or a unique resource identifier (URI) .. which may or may not be an actual available url.. XML schemas makes great use of URI's that don't actually work (namespaces).
"$ref": "https://raw.githubusercontent.com/zwave-js/node-zwave-js/master/packages/config/config/devices/0x0103/ses_fs-zw.json",
"label": "My Label",
"description": "Plug Actuator",
"devices": [
{
"productType": "0x0001",
"productId": "0x0002"
}
]
} Docs: My example uses a url which isn't always what we want (not one that's used as an internet url anyways).. non-internet devices and whatnot.. But the url doesn't necessarily (as i understand) have to be an actual thing .. it just has to exist. For another project I use, Nuget, they use something similar. Their API is all online, so all the references are to actual existing resources, but the interesting part is really that each document they have, has an "@id" property which the unique reference to this document (in their API, this is the actual url it can be found at). Any other document can then reference that document, by linking to the "@id". Examples:
My thinking is that, much like the original "$ref", that some unique identifier be made for these configs. In places that need it, you could either support:
Sidenote: In all cases, I think the actual model of the configs should be the same. Ie., no matter what links or stuff can be done in the files, whatever the users of zwave-js get, is the same as it is today. |
That sounds overly complicated and unnecessary. The ID isn't the problem. It will undo a lot of work on the database website. It's not just changing it in a file, it changes the entire structure of how we store files as right now the manufacturerid comes from the folder name. If the files are no longer separated that way then you have to figure out where the file lives at has both GR, Jasco, and Honeywell devices in. |
my 2c, Once upon a time, browser was reliant on Having just migrated browser to the index, id hate for that to be a lost cause. The only piece of work, that will come of it (looking at the current proposal), is digging deeper into the partials, when parsing the cfg file, to display its info. Edit: |
Updated the proposals after some discussion.
You don't have to do that - the API does that for you. You might only have to be able to display the additional "parent" param. |
@LordMike I hope you don't mind that I hijack your suggestions, but there are a couple of configuration file weirdnesses that I want to discuss.
More concise definition of partial parameters (#1436, proposed by @LordMike)
The current format looks like this:
It's clunky, as we must repeat a number of values between settings - and come up with multiple labels and so on. I propose the following instead (edited by @AlCalzone):
Move manufacturer labels into
devices
arrayWe often have a situation where the same device is available under different brands. This leads to duplicated config files that might go out of sync because contributors only edit the one they know about. Or multiple brands share a manufacturer ID, because the same manufacturer made the device. I suggest we make it possible to move the manufacturer name (and potentially device label) into the devices array:
before:
after
In order to avoid repetition, having the manufacturer and label at the root level should still be allowed. The one in the devices array would have priority.
Conditional configuration parameters
==> Implemented in #1810
Templates/imports
=> Implemented in: #1687
The text was updated successfully, but these errors were encountered: