Skip to content
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

Feature name is mandatory #575

Closed
atrovato opened this issue Oct 24, 2019 · 5 comments
Closed

Feature name is mandatory #575

atrovato opened this issue Oct 24, 2019 · 5 comments

Comments

@atrovato
Copy link
Contributor

According to device boxes, feature name can be null or undefined.
But according to device_feature.js model, it is mandatory.

I think it would be better to let it optional, and to keep the SensorDeviceFeature box solution:

if (feature.name) {
  return feature.name;
} else {
  return device.name + ' - ' + feature.type;
}

What do you think about it ?

@Pierre-Gilles
Copy link
Contributor

This device box is the device box of the gateway, which was done on Gladys 3 which supports null/undefined feature name.

In Gladys 4, I don't think we want null feature name.

What's the use case?

@atrovato
Copy link
Contributor Author

Some integrations discover devices over the network and creates related features. But features name is generated from device name, with -feature.type concatened.

If the feature name is left empty, the UI can handle it, generating the same format ( with - feature.type ) but can be catch by i18n.

@Pierre-Gilles
Copy link
Contributor

Yes it's true that we can do better that how it's done right now, and work on i18n.

The question is always: will it be shown in UI, and if yes: where?

I don't think allowing null is a good idea. Putting a name is a way to make it clear, even on the developer side in the DB.

@Pierre-Gilles
Copy link
Contributor

I think it's ok if all integrations are not doing the same thing.

For example, a camera device-feature name will never be displayed!

@atrovato
Copy link
Contributor Author

Ok I undestand, let see case by case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants